It is currently Tue Nov 19, 2019 8:52 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: 5.43 - TransformSprite()
PostPosted: Tue Oct 11, 2016 9:21 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2002
Location: USA
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:
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.43 - TransformSprite()
PostPosted: Thu May 25, 2017 8:49 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2002
Location: USA
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.43 - TransformSprite()
PostPosted: Fri May 26, 2017 8:14 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Feb 24, 2012 10:19 am
Posts: 115
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:
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.43 - TransformSprite()
PostPosted: Fri May 26, 2017 1:42 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2002
Location: USA
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.43 - TransformSprite()
PostPosted: Wed Oct 09, 2019 3:55 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2002
Location: USA
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.43 - TransformSprite()
PostPosted: Thu Oct 10, 2019 8:49 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Feb 24, 2012 10:19 am
Posts: 115
it works with #PB_Ignore, but "TransformSprite(1, 0, 0, 64, 0, 64, 64, 0, 64)" is better.

Code:
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.43 - TransformSprite()
PostPosted: Thu Oct 10, 2019 1:19 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2002
Location: USA
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye