BRTUTOR5.Cto display a revolving blue cube. Note the selected true colour mode. If you are running BRender under DOS, the following line in the hardware initialisation code selects 320 200, 15-bit true colour:
screen_buffer = DOSGfxBegin("VESA,W:320,H:200,B:15");The following three lines of code are used to apply the material described in
cube.matto our revolving cube:
cube_material = BrFmtScriptMaterialLoad("cube.mat"); BrMaterialAdd(cube_material); cube->material = BrMaterialFind("BLUE MATERIAL");
BrFmtScriptMaterialLoadloads a material from a material script and returns a pointer to an initialised
BrMaterialAddadds the new material to the registry. All materials must be added to the registry before they can be used in rendering.
BrMaterialFind searches for a material by name in the registry. You will recall that
BLUE MATERIAL was the name entered in the identifier field in the material script file
BrMaterialFind returns a pointer to a
br_material (or NULL if the search was unsuccessful).
Use your text editor to experiment with the properties of
BLUE MATERIAL, or to create your own material script files.