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.

I found your problem.

First, your actual data is offset by 10 bytes. If this is can't be changed, then you can get around it by returning the pointer+10.

Second, your Integers are getting poked and peeked wrong. PeekInt bank,3,5 should poke 5 to byte 3. In your case, it pokes 5 to byte (3*4), or 12, plus the 10-byte offset.

In Blitz, you usually use a loop like this for integers:
For n=0 to (BankSize(bank)-1)/4
PeekInt(bank,n*4)
Next

But in your case, that would return values for every 16 bytes.


Allocating a memory buffer of size '8' should give you this:

*pointer
*pointer+1 byte
*pointer+2 byte
*pointer+3 byte
*pointer+4 byte
*pointer+5 byte
*pointer+6 byte
*pointer+7 byte

Now PokeInt(bank,4,69):
*pointer+0
*pointer+1
*pointer+2
*pointer+3
*pointer+4=69 ]
*pointer+5=69 |====This is all one integer,
*pointer+6=69 |====not 69 each byte
*pointer+7=69 ]

PokeInt(bank,1,52) would give:
*pointer+0
*pointer+1=52 ]
*pointer+2=52 |====This is all one integer,
*pointer+3=52 |====not 52 each byte
*pointer+4=52 ]
*pointer+5
*pointer+6
*pointer+7

But your DLL changes it to 1*4 (ignoring the 10-byte offset):
*pointer+0
*pointer+1
*pointer+2
*pointer+3
*pointer+4=52 ]
*pointer+5=52 |====This is all one integer,
*pointer+6=52 |====not 52 each byte
*pointer+7=52 ]