C reference: 3D
These calls come from #include <macaw3d.h>. Each thing in a scene (a camera, a light, a cube, a terrain) is a number, and 0 means none. There are two ways to do 3D: make a scene once and let render() draw it every frame, or make meshes and draw them yourself with your own camera. The 3D page explains both, and C shows how Lua's calls become C ones.
Making things
newcamera
int newcamera(void)
Makes a camera to look through. It starts at 0, 0, 0 looking along z, sees 80 degrees across and clears the picture to NIGHT. The first camera you make is the one render(0) uses.
It takes nothing.
Returns the new camera's number.
newlight
int newlight(const char *kind, double radius, double strength)
Makes a light. A sun lights everything from far away and shines the way it faces, so turn it with rotate3d. A lamp lights things near where you put it.
kind:"sun"or"point"(a lamp).NULLmakes a sun.radius: for a lamp, how far its light reaches, in world units. 0 or less: 8.strength: how bright it is. 0 or less: 0.75 for a sun, 1.2 for a lamp.
Returns the new light's number.
Shapes, terrain and models
newcube
int newcube(int texture, double tiles)
Makes a cube 2 units across, from -1 to 1 each way around its position. Use scale3d to change its size.
texture: the picture to cover it with. 0: plain light grey.tiles: how many times the texture repeats across each face. 0 or less: once.
Returns the new cube's number.
newsphere
int newsphere(int segments, int texture)
Makes a ball 2 units across (a radius of 1).
segments: how many bands it has from top to bottom, with twice as many round it. 0 or less: 12.texture: the picture to wrap round it. 0: plain light grey.
Returns the new ball's number.
newcylinder
int newcylinder(int segments, int texture, int capped)
Makes a cylinder with a radius of 1, from y = -1 to y = 1.
segments: how many flat sides it has round it. 0 or less: 16.texture: the picture to wrap round it. 0: plain light grey.capped: 1 to close the ends with flat discs, 0 to leave it an open tube.
Returns the new cylinder's number.
newcone
int newcone(int segments, int texture)
Makes a cone with its point at y = 1 and a closed, round base of radius 1 at y = -1.
segments: how many flat sides it has round it. 0 or less: 16.texture: the picture to wrap round it. 0: plain light grey.
Returns the new cone's number.
newplane
int newplane(int texture, double tiles)
Makes a flat square 2 units across, lying at y = 0 and facing up. Use it for floors. It can only be seen from above unless you use twosided3d.
texture: the picture to cover it with. 0: plain light grey.tiles: how many times the texture repeats across it. 0 or less: once.
Returns the new square's number.
newterrain
int newterrain(int cells, int heightpicture, int texture, double tiles)
Makes hills from a picture. The terrain goes from -1 to 1 across x and z, with heights from 0 to 1, so scale it up with scale3d.
cells: how many squares it has along each side. 0 or less: 32.heightpicture: a picture stretched over it, where brighter colours are higher. 0: flat.texture: the picture to cover it with. 0: plain light grey.tiles: how many times the texture repeats across the whole terrain. 0 or less:cells/ 4.
Returns the new terrain's number.
newterrainfn
int newterrainfn(int cells, double (*height)(double u, double v), int texture, double tiles)
Makes hills like newterrain, but your own function works out how high each point is.
cells: how many squares it has along each side. 0 or less: 32.height: your function, called once for each corner as the terrain is made. It getsu(across x) andv(along z), each 0 to 1, and returns a height from 0 to 1.NULL: flat.texture: the picture to cover it with. 0: plain light grey.tiles: how many times the texture repeats across the whole terrain. 0 or less:cells/ 4.
Returns the new terrain's number.
newmesh
int newmesh(const float *corners, int ncorners, const int *triangles, int ntriangles, const int *textures, int ntextures, const int *texids)
Makes a thing with a shape of your own, built from triangles.
corners: an array with 5 floats for each corner: x, y, z, then u and v, which say where on the texture it goes (0 to 1 across).ncorners: how many corners there are (not how many floats).triangles: an array with 3 corner numbers for each triangle, counting from 0. The front is the side its corners go round anticlockwise.ntriangles: how many triangles there are.textures: an array of picture numbers for its textures, orNULLfor plain light grey.ntextures: how many pictures are intextures(16 at most are used). 0: plain light grey.texids: an array with one number for each triangle, saying which texture it uses, counting from 0.NULL: all use the first.
Returns the new thing's number.
newmodel
int newmodel(const char *path, const int *textures, int ntextures)
Makes a thing from a model in an .obj file.
path: the.objfile. A path that doesn't start with/is in your program's folder.textures: an array of picture numbers, one for each material in the order they first come in the file.NULL: plain light grey.ntextures: how many pictures are intextures. 0: plain light grey.
Returns the new thing's number, or 0 if the file couldn't be read or has no faces.
newsprite
int newsprite(int picture, double height)
Makes a flat picture that always turns to face the camera, for trees and people. Its bottom middle stands at its position, and its width follows the picture's shape. Colour 0 in the picture is see-through.
picture: the picture to show.height: how tall it is, in world units. 0 or less: 1.
Returns the new sprite's number.
newpivot
int newpivot(void)
Makes an empty, invisible thing. Parent other things to it with parent3d so they move and turn together.
It takes nothing.
Returns the new pivot's number.
What every thing can do
position3d
void position3d(int e, double x, double y, double z, int global)
Puts a thing at a place. If it has a parent, the place is measured from the parent unless global is 1.
e: the thing's number.x: where it goes across, in world units.y: how high it goes.z: where it goes along the third direction, forward into the scene.global: 1 to give a place in the world even if it has a parent, 0 to measure from its parent.
move3d
void move3d(int e, double x, double y, double z)
Moves a thing along the way it's facing, so you can walk a camera forward whichever way it points.
e: the thing's number.x: how far to move to its right, in world units (negative: left).y: how far to move up from its own point of view.z: how far to move forward (negative: backward).
translate3d
void translate3d(int e, double x, double y, double z)
Moves a thing along the world's directions, whichever way it's facing. If it has a parent, these are the parent's directions.
e: the thing's number.x: how far to move across, in world units.y: how far to move up (negative: down).z: how far to move forward along z.
rotate3d
void rotate3d(int e, double yaw, double pitch, double roll)
Turns a thing to face a particular way, whichever way it faced before.
e: the thing's number.yaw: which way round it faces, in degrees. More turns it to the right.pitch: how far it tips, in degrees. More tips its front down.roll: how far it leans to one side, in degrees.
turn3d
void turn3d(int e, double yaw, double pitch, double roll)
Turns a thing by this much from the way it faces now. Call it every frame to keep something spinning.
e: the thing's number.yaw: how far to turn it round, in degrees. Positive turns right.pitch: how far to tip it, in degrees. Positive tips its front down.roll: how far to lean it to one side, in degrees.
point3d
void point3d(int e, int other)
Turns a thing to face another thing, and takes away any lean.
e: the number of the thing to turn.other: the number of the thing it should face.
pointat3d
void pointat3d(int e, double x, double y, double z)
Turns a thing to face a place in the world, and takes away any lean.
e: the thing's number.x: the place's position across, in world units.y: the place's height.z: the place's position along z.
scale3d
void scale3d(int e, double sx, double sy, double sz)
Sets a thing's size. 1 is the size it was made at, and shapes start 2 units across.
e: the thing's number.sx: how much to stretch it across its own x direction (2 is twice as wide).sy: how much to stretch it up its own y direction.sz: how much to stretch it along its own z direction.
parent3d
void parent3d(int e, int parent)
Makes a thing move, turn and grow with another, like a moon going round a planet. It stays where it is in the world when you do it.
e: the number of the thing to attach.parent: the number of the thing it moves with. 0: on its own again.
pos3d
void pos3d(int e, double *x, double *y, double *z)
Finds out where a thing is in the world, counting any parents.
e: the thing's number.x: where to put its x: pass the address of adouble, like&x(orNULL).y: where to put its height: the address of adouble, like&y.z: where to put its z: the address of adouble, like&z.
forward3d
void forward3d(int e, double *x, double *y, double *z)
Finds out which way a thing is facing in the world, as a direction 1 unit long.
e: the thing's number.x: where to put the direction's x: the address of adouble, like&x(orNULL).y: where to put the direction's y (up): the address of adouble, like&y.z: where to put the direction's z: the address of adouble, like&z.
up3d
void up3d(int e, double *x, double *y, double *z)
Finds out which way a thing's top is facing in the world, as a direction 1 unit long.
e: the thing's number.x: where to put the direction's x: the address of adouble, like&x(orNULL).y: where to put the direction's y (up): the address of adouble, like&y.z: where to put the direction's z: the address of adouble, like&z.
dist3d
double dist3d(int e, int other)
Works out how far apart two things are in the world.
e: the first thing's number.other: the second thing's number.
Returns the distance between them, in world units.
hide3d
void hide3d(int e)
Stops drawing a thing, and anything parented to it. Hidden things can't be bumped into or clicked on.
e: the thing's number.
show3d
void show3d(int e)
Starts drawing a thing again after hide3d.
e: the thing's number.
visible3d
int visible3d(int e)
Finds out whether a thing is being drawn.
e: the thing's number.
Returns 1 if it's drawn, or 0 if it or anything it's parented to is hidden.
texture3d
void texture3d(int e, int picture, int n)
Changes the picture a thing is covered with. It doesn't change a sprite's picture.
e: the thing's number.picture: the new picture.n: which of its textures to change, counting from 0. Use 0 unless it's a model with several.
color3d
void color3d(int e, int colour)
Paints a thing all one colour, in place of its texture. On a model with several textures, only the first changes.
e: the thing's number.colour: a colour number, such asORANGE.
fullbright3d
void fullbright3d(int e, int on)
Stops light and shade changing how a thing looks, for lamps, the sky and glowing things.
e: the thing's number.on: 1 to draw it at full brightness, 0 to light it as usual again.
twosided3d
void twosided3d(int e, int on)
Draws the back of each face as well as the front, for flat things seen from both sides.
e: the thing's number.on: 1 to draw both sides, 0 to draw only the front again.
free3d
void free3d(int e)
Takes a thing out of the scene for good. Anything parented to it goes too.
e: the thing's number. Don't use it again afterwards.
height3d
int height3d(int terrain, double x, double z, double *height)
Finds how high the ground of a terrain is at a place, so you can keep things standing on it. It counts the terrain's position and size, but not any turning.
terrain: the terrain's number.x: the place's position across, in world units.z: the place's position along z.height: where to put the ground's height: pass the address of adouble, like&h.
Returns 1 if the place is over the terrain, or 0 if it isn't (and nothing is written).
collide3d
void collide3d(int e, int type, double radius)
Gives a thing a collision type, so collisions and updateworld can make it bump into things. When it moves, it's tested as a ball.
e: the thing's number.type: any number you choose for this kind of thing, such as 1 for the player and 2 for walls.radius: the radius of its ball, in world units. 0 or less: the one it had, or 1.
hitcount3d
int hitcount3d(int e)
Finds out how many things a thing bumped into during the last updateworld().
e: the thing's number.
Returns how many hits it has. Get each one with gethit3d.
gethit3d
int gethit3d(int e, int i, hit3d *hit)
Gets one of the things a thing bumped into during the last updateworld(): the thing, where it touched, and the way the surface there faces.
e: the thing's number.i: which hit, from 0 tohitcount3d(e)- 1.hit: where to put the hit: pass the address of ahit3d, like&hit. Itsdistis 0.
Returns 1 if there was a hit i, or 0 if there wasn't.
pickable3d
void pickable3d(int e, const char *shape)
Lets rays and the mouse hit a thing, so pick and campick3d can find it.
e: the thing's number.shape:"mesh"(its exact shape),"sphere"(a ball round it),"box"(tested exactly, like"mesh") or"none"to stop it.NULL:"mesh".
Cameras
fov3d
void fov3d(int camera, double degrees)
Sets how wide a camera's view is. A small angle zooms in, a big one sees more.
camera: the camera's number.degrees: the angle the camera sees across the picture's width. It starts at 80, and 10 to 170 work.
clscolor3d
void clscolor3d(int camera, int colour)
Sets the colour the picture is cleared to before a camera draws, such as the sky.
camera: the camera's number.colour: a colour number, such asSKY. -1: don't clear, and draw over what's there.
camfog3d
void camfog3d(int camera, double near, double far, int colour)
Adds fog to what a camera sees, so far-off things fade into a colour.
camera: the camera's number.near: how far from the camera the fog starts, in world units. Less than 0: no fog.far: how far away the fog becomes solid, in world units.colour: the fog's colour number. -1: the camera's clear colour (orNIGHTif it doesn't clear).
camproject3d
int camproject3d(int camera, double x, double y, double z, double *sx, double *sy, double *dist)
Works out where a place in the world shows up in a camera's picture, for putting labels over things. It uses the size of the last picture the camera drew (320 by 200 before it has drawn one).
camera: the camera's number.x: the place's position across, in world units.y: the place's height.z: the place's position along z.sx: where to put how far across the picture it is, in pixels: the address of adouble, like&sx.sy: where to put how far down the picture it is, in pixels: the address of adouble, like&sy.dist: where to put how far ahead of the camera it is, in world units: the address of adouble.
Returns 1 if the place is in front of the camera, or 0 if it's behind (and nothing is written).
campick3d
int campick3d(int camera, double x, double y, double max, hit3d *hit)
Finds the pickable thing under a point in a camera's picture, such as the mouse pointer.
camera: the camera's number.x: the point's distance from the picture's left edge, in pixels.y: the point's distance from the picture's top edge, in pixels.max: how far away to look, in world units. 0 or less: no limit.hit: where to put what was hit: pass the address of ahit3d, like&hit(orNULL).
Returns the number of the thing under the point, or 0 if there's nothing there.
The scene
render
void render(int camera)
Draws the whole scene through a camera, into the window (or the picture you're drawing into). Call it in _draw.
camera: the camera's number. 0: the first camera you made.
updateworld
void updateworld(void)
Works out collisions for everything with a collision type: things that ran into something are pushed back out, and their hits are noted. Call it each frame after you move things.
It takes nothing.
collisions
void collisions(int a, int b, const char *shape, const char *response)
Makes things of one collision type bump into things of another.
a: the type of the things that move and bump, as given tocollide3d.b: the type of the things they bump into.shape: how thebthings are tested:"mesh"(exactly),"box"or"sphere".NULL:"mesh".response:"slide"to slide along what they hit, or"stop"to stop.NULL:"slide".
resetcollisions
void resetcollisions(int e)
Forgets where a thing was. Call it after you move something a long way in one go, so it doesn't collide with everything in between.
e: the thing's number.
pick
int pick(double ox, double oy, double oz, double dx, double dy, double dz, double max, hit3d *hit)
Finds the nearest pickable thing along a ray, such as a line of sight or a shot.
ox: where the ray starts across, in world units.oy: the height the ray starts at.oz: where the ray starts along z.dx: the across part of the ray's direction. It can be any length.dy: the up part of the ray's direction.dz: the z part of the ray's direction.max: how far along the ray to look, in world units. 0 or less: no limit.hit: where to put what was hit: pass the address of ahit3d, like&hit(orNULL).
Returns the number of the thing it hit, or 0 if it hit nothing.
ambient
void ambient(double level)
Sets how bright the light is everywhere in the scene, even where no light shines.
level: 0 for none, up to 1 for full brightness. It starts at 0.35.
clearworld
void clearworld(void)
Throws the whole scene away. The next thing you make starts a new, empty one, so don't use the old numbers again.
It takes nothing.
Meshes you draw yourself
clear3d
void clear3d(int colour)
Starts a frame of meshes: it clears the depth buffer, and the picture too if you give a colour.
colour: the colour number to clear the picture to. -1: clear only the depth buffer.
camera3d
void camera3d(double x, double y, double z, double yaw, double pitch, double fov)
Sets where the camera for meshes is and which way it looks.
x: the camera's position across, in world units.y: the camera's height.z: the camera's position along z.yaw: which way round it looks, in degrees. More turns it right.pitch: how far it looks up, in degrees (unlike things, positive is up).fov: the angle it sees across the picture's width, in degrees, kept to 10 to 170. 0 or less: 90.
light3d
void light3d(double dx, double dy, double dz, double sun, double amb)
Sets the sun for meshes: the way its light travels and how strong it is, and the light everywhere.
dx: the across part of the way sunlight travels. The direction can be any length.dy: the up part of the way sunlight travels (negative shines down).dz: the z part of the way sunlight travels.sun: how strong the sun is. Less than 0: 0.75.amb: how bright the light is everywhere, from 0 to 1. Less than 0: 0.35.
Lamps, fog and lines
pointlight3d
void pointlight3d(int n, double x, double y, double z, double radius, double strength)
Sets one of the eight lamps for meshes, which lights things near it, fading out at its radius.
n: which lamp, from 0 to 7.x: the lamp's position across, in world units.y: the lamp's height.z: the lamp's position along z.radius: how far its light reaches, in world units. 0 turns it off.strength: how bright it is. Less than 0: 1.
fog3d
void fog3d(double near, double far, int colour)
Adds fog to meshes, so far-off things fade into a colour.
near: how far from the camera the fog starts, in world units.far: how far away the fog becomes solid, in world units.colour: the fog's colour number.
nofog3d
void nofog3d(void)
Turns the fog off again.
It takes nothing.
project3d
int project3d(double x, double y, double z, double *sx, double *sy, double *dist)
Works out where a place in the world shows up in the picture, seen through camera3d's camera.
x: the place's position across, in world units.y: the place's height.z: the place's position along z.sx: where to put how far across the picture it is, in pixels: the address of adouble, like&sx.sy: where to put how far down the picture it is, in pixels: the address of adouble, like&sy.dist: where to put how far ahead of the camera it is, in world units: the address of adouble.
Returns 1 if the place is in front of the camera, or 0 if it's behind (and nothing is written).
line3d
void line3d(double x0, double y0, double z0, double x1, double y1, double z1, int colour, int thick)
Draws a line between two places in the world, seen through camera3d's camera, over the picture. It isn't hidden behind things, and the part behind the camera is cut off. Use it for outlines and markers.
x0: where the line starts across, in world units.y0: the height the line starts at.z0: where the line starts along z.x1: where the line ends across.y1: the height the line ends at.z1: where the line ends along z.colour: the line's colour number.thick: 1 for a line two pixels wide, 0 for one pixel.
stats3d
int stats3d(void)
Finds out how much 3D drawing there was this frame, for checking your program's speed.
It takes nothing.
Returns how many triangles were drawn since the last clear3d.
Making meshes
cube3d
int cube3d(double w, double h, double d, int texture, double tiles)
Makes a box mesh, seen from outside, centred on 0, 0, 0.
w: how wide it is across x, in world units.h: how tall it is.d: how deep it is along z.texture: the picture on every face. Give a real picture: with 0 nothing is drawn.tiles: how many times the texture repeats across each face. 0: once for every unit. Less than 0: once a face.
Returns the new mesh's number.
cube3dsides
int cube3dsides(double w, double h, double d, int sides, int top, int bottom, double tiles)
Makes a box mesh like cube3d, with different pictures on its sides, top and bottom.
w: how wide it is across x, in world units.h: how tall it is.d: how deep it is along z.sides: the picture on its four sides.top: the picture on top. 0: the sides' picture.bottom: the picture underneath. 0: the top's picture.tiles: how many times the textures repeat across each face. 0: once for every unit. Less than 0: once a face.
Returns the new mesh's number.
room3d
int room3d(double w, double h, double d, int floor, int walls, int ceiling, double tiles)
Makes the inside of a box, for standing in. It's centred on 0, 0, 0, so its floor is at y = -h / 2.
w: how wide it is across x, in world units.h: how tall it is.d: how deep it is along z.floor: the floor's picture.walls: the walls' picture.ceiling: the ceiling's picture. 0: the walls' picture.tiles: how many times the textures repeat across each face. 0 or less: once for every unit.
Returns the new mesh's number.
loadobj
int loadobj(const char *path, const int *textures, int ntextures)
Makes a mesh from a model in an .obj file.
path: the.objfile. A path that doesn't start with/is in your program's folder.textures: an array of picture numbers, one for each material in the order they first come in the file.NULL: plain light grey.ntextures: how many pictures are intextures. 0: plain light grey.
Returns the new mesh's number, or 0 if the file couldn't be read or has no faces.
mesh3d
int mesh3d(const float *corners, int ncorners, const int *triangles, int ntriangles, const int *textures, int ntextures, const int *texids, const char *options)
Makes a mesh of any shape from your own corners and triangles.
corners: an array with 5 floats for each corner: x, y, z, then u and v, which say where on the texture it goes (0 to 1 across).ncorners: how many corners there are (not how many floats).triangles: an array with 3 corner numbers for each triangle, counting from 0. The front is the side its corners go round anticlockwise.ntriangles: how many triangles there are.textures: an array of picture numbers for its textures. Give at least one: without any, nothing is drawn.ntextures: how many pictures are intextures(16 at most are used).texids: an array with one number for each triangle, saying which texture it uses, counting from 0.NULL: all use the first.options: words in a string:"double"draws both sides,"fullbright"ignores the light.NULLor"": neither.
Returns the new mesh's number.
Drawing meshes
billboard3d
void billboard3d(int picture, double x, double y, double z, double height, int fullbright)
Draws a picture standing upright at a place, turned to face camera3d's camera, for trees and people. Its width follows the picture's shape, and colour 0 is see-through.
picture: the picture to draw.x: where its bottom middle goes across, in world units.y: the height its bottom stands at.z: where its bottom middle goes along z.height: how tall it is, in world units. 0 or less: 1.fullbright: 1 to ignore the light, 0 to light it as usual.
drawmesh
void drawmesh(int mesh, double x, double y, double z, double yaw, double pitch, double roll, double scale)
Draws a mesh at a place, turned and sized as you say. Call it each frame, after clear3d and camera3d.
mesh: the mesh's number.x: where it goes across, in world units.y: how high it goes.z: where it goes along z.yaw: how far it's turned round, in degrees. Positive turns it right.pitch: how far it's tipped, in degrees. Positive tips its front down.roll: how far it leans to one side, in degrees.scale: how big it's drawn, the same each way (2 is twice the size). 0 or less: 1.
drawmeshm
void drawmeshm(int mesh, double a, double b, double c, double d, double e, double f, double g, double h, double i, double x, double y, double z)
Draws a mesh with a 3 by 3 transform of your own, to stretch or squash it or turn it in a way you've worked out. Each corner's new x is a·x + b·y + c·z, its y uses d e f and its z g h i, then it's moved to x, y, z.
mesh: the mesh's number.a: the first row's first number: how much a corner's x adds to its new x.b: the first row's second number: how much a corner's y adds to its new x.c: the first row's third number: how much a corner's z adds to its new x.d: the second row's first number: how much a corner's x adds to its new y.e: the second row's second number: how much a corner's y adds to its new y.f: the second row's third number: how much a corner's z adds to its new y.g: the third row's first number: how much a corner's x adds to its new z.h: the third row's second number: how much a corner's y adds to its new z.i: the third row's third number: how much a corner's z adds to its new z.x: where it goes across, in world units.y: how high it goes.z: where it goes along z.
meshtexture
void meshtexture(int mesh, int n, int picture)
Changes one of a mesh's textures.
mesh: the mesh's number.n: which texture, from 0 to 15.picture: the new picture.
meshsize
void meshsize(int mesh, int *corners, int *triangles)
Finds out how many corners and triangles a mesh has.
mesh: the mesh's number.corners: where to put how many corners it has: pass the address of anint, like&n(orNULL).triangles: where to put how many triangles it has: the address of anint(orNULL).
freemesh
void freemesh(int mesh)
Lets go of a mesh when you've finished with it, so its memory can be used again.
mesh: the mesh's number. Don't use it again afterwards.
Textures
loadtexture
int loadtexture(const char *path, int size)
Loads a photo texture from a .tex file, such as one in /system/textures. Bigger photos are shrunk as they load, keeping their shape.
path: the.texfile. A path that doesn't start with/is in your program's folder.size: the most pixels across (or down) to keep, from 8 to 1024. 0 or less: 64.
Returns the new picture's number, or 0 if the file couldn't be read or isn't a .tex.
The graphics card
glrpresent
int glrpresent(void)
Finds out whether a graphics card is doing the drawing. The other calls here only tell you anything when one is.
It takes nothing.
Returns 1 if a graphics card is drawing, or 0 if the processor is.
cubemaps
int cubemaps(void)
Finds out whether the graphics card can draw baked reflections (cube maps).
It takes nothing.
Returns 1 if it can, or 0 if it can't or there's no graphics card.
glrvram
int glrvram(int *used, int *allowed)
Finds out roughly how much of the graphics card's memory your program is using.
used: where to put how many bytes are in use: pass the address of anint, like&used(orNULL).allowed: where to put how many bytes are allowed: the address of anint, like&allowed(orNULL).
Returns 1 if it's using more than it's allowed, or 0 if not. With no graphics card it writes 0s and returns 0.
glrinfotext
int glrinfotext(const char *field, char *buf, int size)
Gets one fact about the graphics card as text, such as its name.
field: which fact:"renderer"(the card's name),"version"(its OpenGL version) or"extensions".buf: where to put the text. It's cut short to fit, and is empty with no graphics card.size: how many bytesbufholds.
Returns how long the whole text is, so you can tell if buf was too small.
glrinfonumber
double glrinfonumber(const char *field)
Gets one fact about the graphics card as a number.
field: which fact:"depthbits","maxtexture"(the biggest texture it takes),"multitexture"or"cubemap"(yes or no), or how its memory is split:"texturebytes","lightmapbytes"or"screenbytes".
Returns the number, 1 or 0 for yes-or-no facts, and 0 for an unknown field or with no graphics card.