Internal Blitz3D Structures

Blitz3D Forums/Blitz3D Programming/Internal Blitz3D Structures

Serpent(Posted 2010) [#1]
Hello everyone,

I'm sure tonnes of people have asked this before - does anybody know anything about the structure of Blitz3D objects in memory?

What I'm really looking for here is the structure of a buffer or texture, but it would be great if anybody has information about others.

On one of my other topics, somebody (I think Charrua or Yasha) posted a link to a blitz forum (in another language) which had some structures listed, but I can't find the link in those topics for some reason! Any knowledge about this would be contributed.

I'm interested in copying memory directly into a buffer as a fast means of transferring image data (see some of my recent posts).


Jiffy(Posted 2010) [#2]
translated (ru->en)
http://translate.googleusercontent.com/translate_c?hl=en&ie=UTF-8&sl=ru&tl=en&u=http://blitz.pp.ru/forum/showthread.php%3Fs%3D969a613d7deeb67f32385669ba81bcbb%26threadid%3D203%26perpage%3D15%26highlight%3D%26pagenumber%3D1&prev=_t&rurl=translate.google.com&usg=ALkJrhgFEE4PoiLUk8jkxkY1WW799-CyrA

untranslated
http://blitz.pp.ru/forum/showthread.php?s=2a85d3d02c25434f31dae3da25e1ca6e&threadid=203

This is prob not up to date. MikhailV from Userlibs/Fast Extend thread may be able to help you.


Kryzon(Posted 2010) [#3]
I'm interested in copying memory directly into a buffer as a fast means of transferring image data (see some of my recent posts).

If you're saying you want to copy a custom buffer into the texture's buffer (so as to allow fast pixel manipulation from C++), that won't be very fast.
I've tried that already. What happens is that the messaging from video card to CPU etc. to perform this operation is rather slow.

Perhaps try using Blit. Might be a better approach.


Serpent(Posted 2010) [#4]
Kryzon: If you see some of my other recent posts you'll see what I'm trying to do - a simple screenshot. The best way I've gotten so far is to BitBlt the screen to a compatible bitmap and then call GetDIBits to get the data in a bank. I then reformat the bank to the appropriate pixel format B3D uses in memory and then use a series of RTLMoveMemory calls to transfer the data from the bank directly into a buffer. Through my testing, the buffer has to be locked to work. I'm assuming that 'Locking' a buffer transfers the data from video memory or wherever into a location in RAM (stored in the internal buffer struct). The MoveMemory calls are very fast.

Jiffy: Thanks! That was the website I was looking for - I'll bookmark it this time.


Edit: Kryzon - bear in mind I don't know much about many of the calls in my screenshot process (it's taken me most of the last month to understand how it works). I'm unsure about BitBlt - if it can be used to directly transfer to a Blitz image, texture, or buffer that would be great.


Kryzon(Posted 2010) [#5]
You should try that, using BitBlt to transfer the surface memory - note the 'surface' word.
I'm hoping it's faster to transfer an appropriately formatted surface-like buffer to another surface, like that of a texture or image.


Serpent(Posted 2010) [#6]
I don't understand what you mean by a 'surface' and don't understand the memory format of device contexts which is why the best way I have is using GetDIBits to get the data in a bank. This is already off the topic of this thread, but if you know more about how to do this - direct bitblt to an image/buffer/etc that would be great.