GrabSprite after UseBuffer()

Everything else that doesn't fall into one of the other PB categories.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

GrabSprite after UseBuffer()

Post by Psychophanta »

Why doesn't work this code?

Code: Select all

InitSprite() 
InitSprite3D() 
InitKeyboard() 
OpenScreen(640,480,32,"") 

CreateSprite(0,128,128,#PB_Sprite_Texture) 
StartDrawing(SpriteOutput(s0)) 
Box(0,50,128,20,$FFFFFF) 
StopDrawing() 
CreateSprite3D(0,0) 

Procedure r() 
  ns.l=CreateSprite(#PB_Any,128,128) 
  RotateSprite3D(0,5-90,0) 
  UseBuffer(ns) 
  Start3D() 
  DisplaySprite3D(0,0,0,255) 
  Stop3D() 
  GrabSprite(0,0,0,128,128,#PB_Sprite_Texture) 
  UseBuffer(-1) 
  CreateSprite3D(0,0) 
  FreeSprite(ns) 
EndProcedure 

Repeat 
  ExamineKeyboard() 
  ClearScreen(0,0,0) 
  r() 
  Start3D() 
  DisplaySprite3D(0,333,333,255) 
  Stop3D() 
  FlipBuffers():Delay(16) 
Until KeyboardPushed(#PB_Key_Escape) 
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Re: GrabSprite after UseBuffer()

Post by Num3 »

Psychophanta wrote:Why doesn't work this code?

Code: Select all

InitSprite() 
InitSprite3D() 
InitKeyboard() 
OpenScreen(640,480,32,"") 

CreateSprite(0,128,128,#PB_Sprite_Texture) 
StartDrawing(SpriteOutput(s0)) <------------ !!!!!!! s0 !?!?!?!!?
Box(0,50,128,20,$FFFFFF) 
StopDrawing() 
CreateSprite3D(0,0) 

Procedure r() 
  ns.l=CreateSprite(#PB_Any,128,128) 
  RotateSprite3D(0,5-90,0) 
  UseBuffer(ns) 
  Start3D() 
  DisplaySprite3D(0,0,0,255) 
  Stop3D() 
  GrabSprite(0,0,0,128,128,#PB_Sprite_Texture) 
  UseBuffer(-1) 
  CreateSprite3D(0,0) 
  FreeSprite(ns) 
EndProcedure 

Repeat 
  ExamineKeyboard() 
  ClearScreen(0,0,0) 
  r() 
  Start3D() 
  DisplaySprite3D(0,333,333,255) 
  Stop3D() 
  FlipBuffers():Delay(16) 
Until KeyboardPushed(#PB_Key_Escape) 
Bonne_den_kule
Addict
Addict
Posts: 841
Joined: Mon Jun 07, 2004 7:10 pm

Re: GrabSprite after UseBuffer()

Post by Bonne_den_kule »

Num3 wrote:
Psychophanta wrote:Why doesn't work this code?

Code: Select all

InitSprite() 
InitSprite3D() 
InitKeyboard() 
OpenScreen(640,480,32,"") 

CreateSprite(0,128,128,#PB_Sprite_Texture) 
StartDrawing(SpriteOutput(s0)) <------------ !!!!!!! s0 !?!?!?!!?
Box(0,50,128,20,$FFFFFF) 
StopDrawing() 
CreateSprite3D(0,0) 

Procedure r() 
  ns.l=CreateSprite(#PB_Any,128,128) 
  RotateSprite3D(0,5-90,0) 
  UseBuffer(ns) 
  Start3D() 
  DisplaySprite3D(0,0,0,255) 
  Stop3D() 
  GrabSprite(0,0,0,128,128,#PB_Sprite_Texture) 
  UseBuffer(-1) 
  CreateSprite3D(0,0) 
  FreeSprite(ns) 
EndProcedure 

Repeat 
  ExamineKeyboard() 
  ClearScreen(0,0,0) 
  r() 
  Start3D() 
  DisplaySprite3D(0,333,333,255) 
  Stop3D() 
  FlipBuffers():Delay(16) 
Until KeyboardPushed(#PB_Key_Escape) 
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

I've got here 2 truths.

But not an answer ...
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Bonne_den_kule
Addict
Addict
Posts: 841
Joined: Mon Jun 07, 2004 7:10 pm

Re: GrabSprite after UseBuffer()

Post by Bonne_den_kule »

Bonne_den_kule wrote:
Num3 wrote:
Psychophanta wrote:Why doesn't work this code?

Code: Select all

InitSprite() 
InitSprite3D() 
InitKeyboard() 
OpenScreen(640,480,32,"") 

CreateSprite(0,128,128,#PB_Sprite_Texture) 
StartDrawing(SpriteOutput(s0)) <------------ !!!!!!! s0 !?!?!?!!?
Box(0,50,128,20,$FFFFFF) 
StopDrawing() 
CreateSprite3D(0,0) 

Procedure r() 
  ns.l=CreateSprite(#PB_Any,128,128) 
  RotateSprite3D(0,5-90,0) 
  UseBuffer(ns) 
  Start3D() 
  DisplaySprite3D(0,0,0,255) 
  Stop3D() 
  GrabSprite(0,0,0,128,128,#PB_Sprite_Texture) 
  UseBuffer(-1) 
  CreateSprite3D(0,0) 
  FreeSprite(ns) 
EndProcedure 

Repeat 
  ExamineKeyboard() 
  ClearScreen(0,0,0) 
  r() 
  Start3D() 
  DisplaySprite3D(0,333,333,255) 
  Stop3D() 
  FlipBuffers():Delay(16) 
Until KeyboardPushed(#PB_Key_Escape) 
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Dammit, you didn't see it :P

Code: Select all

StartDrawing(SpriteOutput(s0)) <------------ !!!!!!! s0 !?!?!?!!?
filperj
User
User
Posts: 77
Joined: Tue Sep 16, 2003 8:53 pm
Location: Nevers(France)

Post by filperj »

UseBuffer() has no effect on DisplaySprite3D().
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

filperj wrote:UseBuffer() has no effect on DisplaySprite3D().
Mmmm... that seems the answer. :roll:


And num3: s0 value is 0 :!:

This thread should be renamed as "Things to look at: Stupidity Open-competition"


...and the winner iiiss:... Bonne_den_kule ... ImageImageImage

...and the silver medal is fooooor... ... nuuuuummmm3 ... who is from now on upgraded to num2 ImageImageImageImageImage
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Post Reply