It is currently Thu Sep 19, 2019 3:23 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: v5.20 LTS, DisplaySprite() has varying results in OpenGL
PostPosted: Mon Oct 14, 2013 7:45 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 3573
Location: Utah, USA
Here is some test code that displays a rotated sprite in OpenGL.

The sprite is rotated and then displayed at a set position.

Everything works fine until the line that is commented is uncommented.

It should display the sprite over the top of the previous sprite at the same location but instead it shows a sprite that moves up and down the screen in addition to being rotated.

Code:
CompilerIf Subsystem("OpenGL") <> 1
  MessageRequester("Error", "Test requires OpenGL subsystem be used"): End
CompilerEndIf

InitSprite()

OpenWindow(0, 0, 0, 800, 600, "SCREEN", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0)

CreateSprite(1, 256, 256)
StartDrawing(SpriteOutput(1))
  Box(0,0,128,128,$FF0000)
  Box(128,0,128,128,$00FF00)
  Box(0,128,128,128,$0000FF)
  Box(128,128,128,128,$00FFFF)
StopDrawing()

Repeat
  event = WindowEvent()
  ClearScreen(0)
 
  angle.f+0.02
  RotateSprite(1, Degree(angle), #PB_Absolute)
  DisplaySprite(1, 128, 128)
  ;DisplaySprite(1, 128, 128) ;when this is uncommented it displays a sprite that moving up and down on the screen, why?
 
  FlipBuffers()
Until event = #PB_Event_CloseWindow


In case you are curious the code works fine in DirectX.

In case you are also curious, if you add additional displays of the same sprite at other locations (without any other changes) all of the copies after the first one will likewise move up and down in unison.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: v5.20 LTS, DisplaySprite() has varying results in OpenGL
PostPosted: Mon Oct 14, 2013 8:20 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Apr 12, 2013 1:55 pm
Posts: 1058
Location: just outside of Ferguson
On UBUNTU Linux 13.04 (for a few days longer ;)),
I had to remove your
"CompilerIf Subsystem("OpenGL") <> 1
MessageRequester("Error", "Test requires OpenGL subsystem be used"): End
CompilerEndIf"

code to be able to run your nausea activation display program, :oops:
And the sprite continues to rotate about as it orbits some undefined point, for as long as the program runs.

But yes upon uncommenting, I got the vertically bouncing sprite as well.
(it also continues to spin and orbit at the same rate as the original)
Which greatly adds to the nausea factor I might add.
Nice touch. :mrgreen:

No UBUNTU isn't Windows, but I thought you'd like to know.

_________________
Keep it BASIC.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


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