DiagnosticCategory$ ( index )
Parameters
| index - record to read, from 1 (oldest) through CountDiagnostics() |
Description
|
Returns the subsystem label of a diagnostic record, such as "model" or "texture". The category names which part of the engine filed the record, which makes it the natural filter when you only care about one kind of problem. Categories in use include "model" (mesh loading), "texture" (texture loads and reloads), "shader", "renderer", "decal", "capture" and "font-sheet"; "diagnostics" marks the store's own overflow notice. A typical use: after loading a level, walk the store and collect every record whose category is "model" or "texture" into an on-screen list of missing assets. An index below 1 or above CountDiagnostics() stops the program with a runtime error. Requires Extended mode. See also: CountDiagnostics, DiagnosticLevel, DiagnosticSource, DiagnosticMessage. |
Example
; DiagnosticCategory Example ; -------------------------- ; Requires Extended mode. Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,1,-6 light=CreateLight() RotateEntity light,45,45,0 pad=CreateCylinder() ScaleEntity pad,1.5,0.1,1.5 EntityColor pad,80,200,255 ; Two failed asset loads seed the diagnostic store with records to browse enemy=LoadMesh("enemy_model.glb") powerup=LoadMesh("powerup_model.glb") index=1 While Not KeyDown(1) ; Space adds another failure, [ and ] browse the records If KeyHit(57) Then crate=LoadMesh("crate_model.glb") If KeyHit(26) And index>1 Then index=index-1 If KeyHit(27) And index<CountDiagnostics() Then index=index+1 TurnEntity pad,0,1,0 ; Arrow keys move the camera If KeyDown(200) Then MoveEntity camera,0,0,0.1 If KeyDown(208) Then MoveEntity camera,0,0,-0.1 If KeyDown(203) Then TurnEntity camera,0,1,0 If KeyDown(205) Then TurnEntity camera,0,-1,0 RenderWorld Text 0,0,"[ / ] : browse records Space: add failure Arrows: camera Esc: exit" Text 0,20,"Record "+index+" of "+CountDiagnostics() ; DiagnosticCategory names the subsystem that produced the record Text 0,40,"DiagnosticCategory("+index+") = "+DiagnosticCategory(index) Flip Wend End
Index