Page 2 of 2

Re: DigitalClock Animation

Posted: Sat Sep 10, 2016 12:42 am
by Keya
StarBootics wrote:By the way did you try my version of Snakes of balls demo on WinXP and Win 7 ?
i just get the same "Can't open screen !" errmsg

Re: DigitalClock Animation

Posted: Sat Sep 10, 2016 1:42 am
by StarBootics
I can't reproduce this problem under WinXP, I get an error about creating sprites instead.

I don't have any computer with Win7 so you will have to figure out the problem your self. Perhaps a bug in PureBasic V5.50.

If you try this code :

Code: Select all

If InitKeyboard() = 0 Or InitSprite() = 0 Or InitMouse() = 0 ; Or InitSprite3D() = 0
  MessageRequester("ERROR","Can't initialize DirectX !")
  End 
EndIf 

ExamineDesktops()
Screen_W = DesktopWidth(0)
Screen_H = DesktopHeight(0)

If OpenScreen(Screen_W, Screen_H, 32, "Sprite Demo") = 0 
  MessageRequester("ERROR", "Can't open 32 bit screen !")
  If OpenScreen(Screen_W, Screen_H, 24, "Sprite Demo") = 0 
    MessageRequester("ERROR", "Can't open 24 bit screen !")
    If OpenScreen(Screen_W, Screen_H, 16, "Sprite Demo") = 0 
      MessageRequester("ERROR", "Can't open 16 bit screen !")
      End
    EndIf
  EndIf
EndIf 

Repeat 
  
  If IsScreenActive() 
    
    ClearScreen(0)
 
  Else 
    
    Delay(10) 
    
  EndIf 
  
  FlipBuffers() 
  ExamineMouse()
  ExamineKeyboard() 
  
Until KeyboardPushed(#PB_Key_All) ; MouseDeltaX() Or MouseDeltaY() Or MouseWheel() Or 

CloseScreen()

End 
What do get as error message ?

Best regards
StarBootics

Re: DigitalClock Animation

Posted: Sat Sep 10, 2016 2:50 am
by Keya
in both XP and Win7 i get the same result ... Can't open 32bit screen, click ok, then Cant open 24bit screen, click ok, then Cant open 16bit screen

Re: DigitalClock Animation

Posted: Sat Sep 10, 2016 3:05 am
by StarBootics
Keya wrote:in both XP and Win7 i get the same result ... Can't open 32bit screen, click ok, then Cant open 24bit screen, click ok, then Cant open 16bit screen
Very strange to me, look like a bug somewhere within PureBasic it's self.

Just for curiosity :

Code: Select all

  InitSprite()

  If ExamineScreenModes()
    While NextScreenMode()
      Debug Str(ScreenModeWidth())+"x"+Str(ScreenModeHeight())+"x"+Str(ScreenModeDepth())+"@"+Str(ScreenModeRefreshRate())+"Hz"
    Wend
  EndIf
Best regards
StarBootics

Re: DigitalClock Animation

Posted: Sat Sep 10, 2016 3:14 am
by Keya
800x600x16@60Hz
640x480x16@60Hz
1024x768x16@60Hz
1152x864x16@60Hz
1280x960x16@60Hz
800x600x32@60Hz
640x480x32@60Hz
1024x768x32@60Hz
1152x864x32@60Hz
1280x960x32@60Hz
1280x960x32@60Hz
800x600x32@60Hz

im using 5.42LTS, but i just also tested with 5.31 and same problem
I also redid all the tests in both inside VM and on my non-VM host machine, same problem
I dont play any games so perhaps i dont have directx or opengl or whatever installed - if that's needed?

Re: DigitalClock Animation

Posted: Sat Sep 10, 2016 3:27 am
by StarBootics
Keya wrote:800x600x16@60Hz
640x480x16@60Hz
1024x768x16@60Hz
1152x864x16@60Hz
1280x960x16@60Hz
800x600x32@60Hz
640x480x32@60Hz
1024x768x32@60Hz
1152x864x32@60Hz
1280x960x32@60Hz
1280x960x32@60Hz
800x600x32@60Hz

im using 5.42LTS, but i just also tested with 5.31 and same problem
This doesn't make any sense ! You should be able to open a screen properly with one of these settings. You should report this as a bug under Windows. But first make sure you have the latest graphic card driver installed, perhaps the problem came from there.

Edit : I have discovered an issue in the FullScreen Module, it's now corrected, see the First post for the download link.

Best regards
StarBootics

Re: DigitalClock Animation

Posted: Tue Sep 13, 2016 9:57 am
by Kwai chang caine
StarBootics wrote:Can you run this code and post back the Debugger output ?
Best regards
StarBootics
Excuse me for the late answer :oops:
This is the result
Debugger wrote:1680
1050
32

Re: DigitalClock Animation

Posted: Tue Sep 13, 2016 5:52 pm
by StarBootics
Hello everyone,

I have updated the source to solve the problem pointed out by Kwai chang caine (thanks by the way), see DigitalClock::CreateScreen() instruction for details.
See the first post for the download link.

Best regards
StarBootics

Re: DigitalClock Animation

Posted: Sat Apr 25, 2020 6:04 pm
by StarBootics
Hello everyone,

I have take a little break from my game project and re-visited an old code. So this is the version 6 of the DigitalClock FullScreen animation. Nothing is different from the previous version. The main difference is the OOP programming style just to see if the code get any slower in comparison with the Modular approach. I don't see any difference at all. You can download the new source code here :

https://www.dropbox.com/s/vo9v57dh41488 ... 6.zip?dl=0

Best regards
StarBootics