A bit lame but quite relaxing to watch...

Developed or developing a new product in PureBasic? Tell the world about it.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by chr1sb.

Code: Select all

ScreenWidth = 640 ;Higher resolution = smoother dots.
ScreenHeight = 480 ;Setting this higher doesn't affect performance much - because we only draw one sprite on the screen.
ScreenDepth = 32 ;[16 or 32] When color depth is set to 16 everything goes green on my monitor! why?
Squirm=16 ;[1 to 255]  lower value = more squirm!
Density=512 ;Number of new dots per frame.


InitSprite()
InitKeyboard()
InitSprite3D()


OpenScreen(ScreenWidth, ScreenHeight, ScreenDepth, "SquirmDots")


CreateSprite(0,3,3,#PB_Sprite_Memory)
CreateSprite(1,256,256,#PB_Sprite_Texture) ;This really only needs to be 256*192 but it's square for compatibility. 
TransparentSpriteColor(0, 255, 0, 255) 
TransparentSpriteColor(1, 255, 0, 255)
UseBuffer(0)
DisplayRGBFilter(1, 1, 1, 1, 255, 255, 255) 
CreateSprite3D(0, 1)
Sprite3DQuality(1)
ZoomSprite3D(0, ScreenWidth,ScreenWidth) ;Yes, ScreenWidth twice - to maintain correct aspect of our square sprite.


Repeat
   FlipBuffers()
   UseBuffer(1)
      For x=0 To Density
         DisplaySprite(0,Random(253), Random(189))
      Next
   UseBuffer(-1)
   Start3D()
      DisplaySprite3D(0,0,0,Squirm) 
   Stop3D()
   ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All)


End

Only tested on my PC (Athlon XP 1900, Geforce3 ti200, Windows XP) but should run OK on other systems. I'd be interested to know if anyone else sees everything in green when ScreenDepth is set to 16. I don't know if it's a bug or if there's a problem with my code (like maybe I shouldn't have UseBuffer() on a #PB_Sprite_Texture sprite?)

chr1sb
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> InitSprite()
> InitKeyboard()
> InitSprite3D()

On Windows NT, I get a debugger error saying that InitSprite must be
called before InitSprite3D. If I then tick "Make NT compliant exe",
I get a compile error saying "Can't create PureBasic.exe (already
running?)".

Now, this is my work's NT box, so it probably doesn't have DirectX
installed, so I assume more error-checking is needed by PureBasic in
such cases, or at least a better error description (such as: "Does
this machine have DirectX 7.0 installed?") or something...


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

under NT4 there is no DirectX 7 available(and will never).
Complicant means only DirectX-3 compatible(Correct me Fred if i'm wrong).So most of the Stuff will not work under NT4 :cry:

Its a long way to the top if you wanna .....CodeGuru
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

Interesting, it look like little worms to me...
It works fine on W2k-Sp3/Matrox G400.

> ...sees everything in green when ScreenDepth is set to 16

Yes, seems to be the same. But it's a nice green :)

Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Nice little code.. About NT4, all 3D functions aren't supported...



Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by chr1sb.
Originally posted by PB

I assume more error-checking is needed by PureBasic in
such cases
It isn't PureBasic's fault - normally I would include checks for this in my program, but when posting to the forum I try to make code snippets as small as possible.

Like Fred says, all 3D functions aren't supported under NT4. The only thing my code uses 3D funtions for is to stretch my 256x256 sprite to fill the screen - So I think it is maybe possible to make a similar effect without using 3D fuctions.

But I don't think it matters because you should be working when you are at your work's NT4 computer, not lookingat patterns! :)
Originally posted by Franco

it look like little worms to me
Yes - I was suprised when I saw this effect because I was just experimenting with the UseBuffer() function and expected to see random dots fading in and out - when I sit back from the monitor and let my eyes go out of focus I see strange tendril type patterns emerging...


chr1sb
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> I don't think it matters because you should be working when you are
> at your work's NT4 computer, not lookingat patterns! :)

I just checked it out at home (W2K) and it looks cool!


PB - Registered PureBasic Coder
Post Reply