Draw sprite on another sprite with UseBuffer() ?

Advanced game related topics
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Draw sprite on another sprite with UseBuffer() ?

Post by va!n »

I am using PB 4.6b3 and even with earlier versions i dont get it work on the x86 nor on x64 version. I want to draw a sprite on another sprite for a special realtime effect. I have tried Grabsprite as solution but its slow like hell when grabbing each frame a big area for a special realtime fx. How can i draw a sprite (2d/3d) on another? Something i tried, basic...

Code: Select all

LoadSprite(0,...  )
CreateSprite(10,... )    ; Dimensions are a lot bigger as the loaded sprite

; Inside the mainloop

UseBuffer(10)
    DisplaySprite(0,0,0)     
UseBuffer(#PB_Default)

DisplaySprite(10,.. )
Sprite 10 is everytime empty... i can just only draw stuff on it with the 2d drawing commands and using SpriteOutput().... But drawing sprites on another does not work here for me, even with the latest PB version... Did i miss somehing or still doing something wrong? Thx
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
STARGÅTE
Addict
Addict
Posts: 2265
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Draw sprite on another sprite with UseBuffer() ?

Post by STARGÅTE »

UseBuffer() works only with DirectX7 not with DirectX9

So use subsystem: DirectX7
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Re: Draw sprite on another sprite with UseBuffer() ?

Post by va!n »

Init DX7 fails on my modern PC with WIn7!
Btw, DX7 in 2011? I cant believe
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
J. Baker
Addict
Addict
Posts: 2196
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Draw sprite on another sprite with UseBuffer() ?

Post by J. Baker »

va!n wrote:Btw, DX7 in 2011? I cant believe
DirectX 7 still rules! I still run it on my old pc. I love when games look like games and not so realistic. Maybe I'm old school but that's the way I like it. ;)

Yeah DX7 will not work on Win7. Come back to XP. ;)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
Post Reply