Width and height are the size of the texture. Note that the actual texture size may be different from the width and height requested, as different types of 3D hardware support different sizes of texture.
The optional flags parameter allows you to apply certain effects to the texture. Flags can be added to combine two or more effects, e.g. 3 (1+2) = texture with color and alpha maps.
Here some more detailed descriptions of the flags:
1: Color - colour map, what you see is what you get.
2: Alpha - alpha map. If an image contains an alpha map, this will be used to make certain areas of the texture transparent. Otherwise, the colour map will be used as an alpha map. With alpha maps, the dark areas always equal high-transparency, light areas equal low-transparency.
4: Masked - all areas of a texture coloured 0,0,0 will not be drawn to the screen.
8: Mipmapped - low detail versions of the texture will be used at high distance. Results in a smooth, blurred look.
16: Clamp u - Any part of a texture that lies outsides the U coordinates of 0-1 will not be drawn. Prevents texture-wrapping.
32: Clamp v - Any part of a texture that lies outsides the v coordinates of 0-1 will not be drawn. Prevents texture-wrapping.
64: Spherical environment map - a form of environment mapping. This works by taking a single image, and then applying it to a 3D mesh in such a way that the image appears to be reflected. When used with a texture that contains light sources, it can give some meshes such as a teapot a shiny appearance.
128: Cubic environment map - a form of environment mapping. Cube mapping is similar to spherical mapping, except it uses six images each representing a particular 'face' of an imaginary cube, to give the appearance of an image that perfectly reflects its surroundings.
When creating cubic environment maps with the CreateTexture command, cubemap textures must be square 'power of 2' sizes. See the SetCubeFace command for information on how to then draw to the cubemap.
When loading cubic environments maps into OpenB3D using [LoadAnimTexture], all six images relating to the six faces of the cube must be contained within the one texture, and be laid out in a horizontal strip in the following order - left, forward, right, backward, up, down. The images comprising the cubemap must all be power of two sizes.
Please note that not some older graphics cards do not support cubic mapping.
Once you have created a texture, use [BufferToTex] to copy an image to it. To display 3D graphics on a texture, one option is to copy from the backbuffer to the texturebuffer, another is to directly render the image from a camera to the texture.