Memory to Buffer/VideoMemory

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Dr.Delirium Tremens
New User
New User
Posts: 7
Joined: Wed Sep 10, 2003 1:34 am

Memory to Buffer/VideoMemory

Post by Dr.Delirium Tremens »

This is to aid in the speed up Graphics

You have a bank of memory with image data

Modify some data here and there, modify some more later on.

Great, but we don't want to draw it all pixel by pixel.
Too slow.

If PureBasic had commands to copy and paste, to and from videomemory/buffers/banks whatever, then some cool effects could be had.

Lastly, some commands to do some of the dirty work for transparency on these non video memory areas. Plus any other useful memory manipulation commands (and,xor,not etc...)

I guess what I am getting at is having a way to have pseudo bitplanes that can be copied,combined and manipulated to various degrees.

So, in an example

I got a background in bank 1
I got a forground in bank 2
I got particle effects in bank 3
and maybe several other banks

so....

BEFORE tranfering all this to the display / backbuffer
we first combine and/or copy the various banks and send them to a destination bank and when everything is done, THEN we send this to the video buffer.



CombineBanks [BankSource1,BankSource2,BankDestination,(boolean)]
CopyBank [BankSource1,BankDestination,(boolean)]
FillBank[Bank,<value>]

of coarse some sort of coordinate system or boundry should be implemented
to transfer certain sections

The list could go on.. like increment every number in the bank by N

Lastly, performing 2d operations in banks as if it were video memory, like circle,plot,box etc..

That's it I guess. I was spoiled on the Amiga with all the blitting and stuff. Feel free to ignore this Fred unless it has any merit what-so-ever. I will pray silently to myself. Maybe there are commands to do this and just have not seen them yet.

FYI: I am current Blitz2D and Blitz3d user. I unfortunately could not shell out yet more money on BlitzPlus and then later BlitzMax. I understand people need to make money, but I like to keep some of mine. I possibly made the mistake of purchasing IBasic too, because it had a lot of what Blitz lacked, but THEN I see PureBasic and I feel I wasted both time and money... but I really do love Blitz and I feel for Mark, I really do.

PureBasic appears to have the best of many worlds, so far I am HIGHLY impressed. This will probally be my next purchase, and will gladly pay for major updates if PureBasic is as good as I think it is. (I know updates are free... ::people do need to make money though:: :wink: )

Great Work Fred and Great community. Man, do I feel warm and fuzzy now!
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Post by Paul »

Have you looked at the Movie and Sprite commands at all?

Currently you can map a video clip to a sprite and then do anything you want to it effect and graphic wise.
Image Image
Dr.Delirium Tremens
New User
New User
Posts: 7
Joined: Wed Sep 10, 2003 1:34 am

Post by Dr.Delirium Tremens »

Once again, thanks Paul. I will check on this too. I assumed sprites and other "images" were video memory and thus slower to manipulate especially when it came to reading from them.

Oh well,

Like I said, I will research much deeper before spouting out request.

Need some sleep now, cause Warm and Fuzzy has turned into groggy and hazy! :?
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

If you read the help file on Loadsprite() you'll see that you can choose what memory "type" to put it in... :)
LoadSprite()

Syntax

Result = LoadSprite(#Sprite, FileName$ [, Mode])
Description

Load the specified sprite into memory for immediate use. The sprite can be in BMP (uncompressed form) or any other format supported by the ImagePlugin library. It can have any dimensions and be in either 256 colors, 16 bits, 24 bits or 32 bits. A screen should be opened with OpenScreen() or OpenWindowedScreen() before loading a sprite. If an error occurs the value 0 is returned, otherwise the sprite was loaded successfully. A loaded sprite can be freed by using the FreeSprite() command. The following commands can be used to enable automatically more image formats:

UseJPEGImageDecoder()
UsePNGImageDecoder()
UseTIFFImageDecoder()
UseTGAImageDecoder()

The 'Mode' parameter is optional and can take the following values:
0 : Default mode. Sprite resides in video memory (if possible)
#PB_Sprite_Memory : Sprite is loaded into main PC memory (for SpecialFX)
#PB_Sprite_Alpha : Sprite is 8 bits grayscale and will be used by DisplayAlphaSprite() or DisplayShadowSprite()
#PB_Sprite_Texture: Sprite is created with 3D support - useful for the CreateSprite3D() command of the Sprite3D library.
*edit* got to learn to type *edit*

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
Post Reply