5.43 - TransformSprite()

Post bugreports for the Windows version here
User avatar
J. Baker
Addict
Addict
Posts: 2111
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

5.43 - TransformSprite()

Post by J. Baker »

This works on my old graphics card but not on my Nvidia GT 630 under DirectX. Using TransformSprite() keeps the sprite from displaying. Under "OpenGL" it will display but of course the Z values don't do anything.

Code: Select all

InitSprite()

If OpenWindow(0, 0, 0, 640, 480, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
   OpenWindowedScreen(WindowID(0), 0, 0, 640, 480, 0, 0, 0)
   
   ;LoadSprite(0, #PB_Compiler_Home + "examples/sources/Data/PureBasicLogo.bmp")
   
   CreateSprite(1, 64, 64)
   StartDrawing(SpriteOutput(1))
     Box(0, 0, 64, 64, $ffffff)
   StopDrawing()
    
Repeat

  ClearScreen(0)
  
  TransformSprite(1,    0, 0, 0,    64, 0, 0,   64, 64,  0,     0, 64, 0)
  DisplaySprite(1, 0, 0)
    
  FlipBuffers()
    
Until WindowEvent() = #PB_Event_CloseWindow

EndIf
www.posemotion.com

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

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
User avatar
J. Baker
Addict
Addict
Posts: 2111
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: 5.43 - TransformSprite()

Post by J. Baker »

Can anyone else confirm this on their pc? Still does not work in PB 5.60.

Thanks! ;)
www.posemotion.com

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

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
Mesa
Enthusiast
Enthusiast
Posts: 228
Joined: Fri Feb 24, 2012 10:19 am

Re: 5.43 - TransformSprite()

Post by Mesa »

Yes, i've got tthe same problem with XPSP3 32b, pb 5.60 x86.

But it works if you set a non zero value on "Z":

Code: Select all

InitSprite()

If OpenWindow(0, 0, 0, 640, 480, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
		OpenWindowedScreen(WindowID(0), 0, 0, 640, 480, 0, 0, 0)
		
		;LoadSprite(0, #PB_Compiler_Home + "examples/sources/Data/PureBasicLogo.bmp")
		
		CreateSprite(1, 64, 64)
		StartDrawing(SpriteOutput(1))
			Box(0, 0, 64, 64, $ffffff)
		StopDrawing()
		
Repeat

	ClearScreen(0)
	
	TransformSprite(1,    0, 0, 1,    64, 0, 1,   64, 64,  1,     0, 64, 1)
; 	TransformSprite(1,    0, 0,     64, 0,    64, 64,       0, 64) ; woks too
	DisplaySprite(1, 0, 0)
		
	FlipBuffers()
		
Until WindowEvent() = #PB_Event_CloseWindow

EndIf


Mesa.
User avatar
J. Baker
Addict
Addict
Posts: 2111
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: 5.43 - TransformSprite()

Post by J. Baker »

Thanks Mesa! You are right. Under DirectX, the Z values must at least be 1. Not sure if this is the way Fred intended or if it's how newer graphics cards work? If so, problem solved.
www.posemotion.com

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

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
User avatar
J. Baker
Addict
Addict
Posts: 2111
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: 5.43 - TransformSprite()

Post by J. Baker »

Still an issue in v5.71.

I almost re-posted this issue but saw that I had this issue before. Drove me nuts for about five minutes. The debugger should alert if the Z values are not at least 1. Otherwise the sprite is hidden or not displayed.

Just a suggestion. ;)
www.posemotion.com

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

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
Mesa
Enthusiast
Enthusiast
Posts: 228
Joined: Fri Feb 24, 2012 10:19 am

Re: 5.43 - TransformSprite()

Post by Mesa »

it works with #PB_Ignore, but "TransformSprite(1, 0, 0, 64, 0, 64, 64, 0, 64)" is better.

Code: Select all

InitSprite() 

If OpenWindow(0, 0, 0, 640, 480, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) 
  OpenWindowedScreen(WindowID(0), 0, 0, 640, 480, 0, 0, 0) 
  
  ;LoadSprite(0, #PB_Compiler_Home + "examples/sources/Data/PureBasicLogo.bmp") 
  
  CreateSprite(1, 64, 64) 
  StartDrawing(SpriteOutput(1)) 
  Box(0, 0, 64, 64, $ffffff) 
  StopDrawing() 
  
  Repeat 
    
    ClearScreen(0) 
    
    TransformSprite(1,   0, 0, #PB_Ignore,   64, 0, #PB_Ignore,   64, 64,  #PB_Ignore,     0, 64, #PB_Ignore) 
    ; 	TransformSprite(1, 0, 0, 64, 0, 64, 64, 0, 64) ; works too 
    DisplaySprite(1, 0, 0) 
    
    FlipBuffers() 
    
  Until WindowEvent() = #PB_Event_CloseWindow 
  
EndIf
M.
User avatar
J. Baker
Addict
Addict
Posts: 2111
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: 5.43 - TransformSprite()

Post by J. Baker »

Mesa wrote:it works with #PB_Ignore, but "TransformSprite(1, 0, 0, 64, 0, 64, 64, 0, 64)" is better.
As you know, you need the Z values. Unless you are using solid colors. ;)
www.posemotion.com

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

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


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