3D OpenGL Engine

BlitzPlus Forums/BlitzPlus Programming/3D OpenGL Engine

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.

What is the advantage of switching screen resolution from a DLL, rather than Blitz?

The Blitz bank structure is simply two memory buffers. The first one is the actual bank variable, and is always size 12. Here is the structure:

0 - C function pointer (don't worry about it, I just make it 0)
4 - pointer to second memory buffer
8 - size of second memory buffer

When a bank is resized, the pointer at position 4 might become a totally different memory buffer, but the bank variable still works because it doesn't change.

Pseudo code:
Procedure BankAddress(bank)
Return PeekL(bank,4)
EndProcedure

Procedure BankSize(bank)
Return PeekL(bank,8)
EndProcedure

Procedure ResizeBank(bank,size)
pointer=PeekL(bank,4)
freememory pointer
newpointer=AllocateMemory(size)
PokeL bank,4,newpointer
PokeL bank,8,size
EndProcedure