OOP... If You Don't Wanna Hear It From Me...

Miscellaneous Forums/General Discussion/OOP... If You Don't Wanna Hear It From Me...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Ha, that's the whole basis of most of my programming.

From my class declaration file:
Const CLASS_BRUSH=1
Const BRUSH_BUFFERSIZE=140
Const BRUSH_PROPERTIES=116
Const BRUSH_FACELIST=16
Const BRUSH_CORNERLIST=20
Const BRUSH_EDGELIST=24
Const BRUSH_COLOR=28
Const BRUSH_CENTERX=32
Const BRUSH_CENTERY=36
Const BRUSH_CENTERZ=40
Const BRUSH_MINX=44
Const BRUSH_MINY=48
Const BRUSH_MINZ=52
Const BRUSH_MAXX=56
Const BRUSH_MAXY=60
Const BRUSH_MAXZ=64
Const BRUSH_POLYCOUNT=68
Const BRUSH_VERTEXCOUNT=72
Const BRUSH_HIDDEN=120
Const BRUSH_EXTENTSCHANGED=124
Const BRUSH_RENDERCOLOR=128
Const BRUSH_LIGHTMODE=132
Const BRUSH_FLIPPED=136


Now a brush command:
Function CreateBrush()
brush=CreateBank(BRUSH_BUFFERSIZE)
PokeInt brush,0,CLASS_BRUSH
PokeInt brush,4,0
If Not BRUSHBUFFER BRUSHBUFFER=CreateBank()
AppendInt BRUSHBUFFER,brush
PokeInt brush,BRUSH_FACELIST,CreateBank()
PokeInt brush,BRUSH_CORNERLIST,CreateBank()
PokeInt brush,BRUSH_EDGELIST,CreateBank()
PokeInt brush,BRUSH_PROPERTIES,0
PokeInt brush,BRUSH_EXTENTSCHANGED,True
Return brush
End Function


To go through brushes:
Function CountBrushes()
If BRUSHBUFFER Return BankSize(BRUSHBUFFER)/4
End Function

Function Brush(n)
Return PeekInt(BRUSHBUFFER,(n-1)*4)
End Function


So some program code looks like this:
brush=CreateBrush()

For n=1 to CountBrushes()
	Brush(n)
Next