Desktop FX

Share your advanced PureBasic knowledge/code with the community.
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Image
Good programmers don't comment their code. It was hard to write, should be hard to read.
Clutch
User
User
Posts: 52
Joined: Sun Nov 26, 2006 6:11 am
Location: South Florida

Post by Clutch »

Very nice! :D
"Ahead one third... ahead two thirds... Full ahead flank
And out from the belly of the whale came a prophet, Amen"
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

Cool idea and very well done :!:
regards,
benny!
-
pe0ple ar3 str4nge!!!
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Wow, that is really impressive.
I looked at the code and must admit I get lost there hehehe
Great coding
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Psychophanta, do you think you could comment the code a bit so us n00bs can understand and learn from your code? ;)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

GeoTrail wrote:Psychophanta, do you think you could comment the code a bit so us n00bs can understand and learn from your code? ;)
As is commented in the code, it uses the SuperSprite3D lib by CPL.Bator, but i have modified the functions a little bit.
I will now post the code (in the first post) a bit more cutted down.

Anyway there is something wrong in my code, because the plane doesn't seem to have a real perspective, and the problem is in the camera, well i will correct if i have a time.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

techjunkie wrote:Wow! Can't you do a "Beryl" clone for Windows? :wink:
http://wiki.beryl-project.org/wiki/Main_Page
http://www.youtube.com/watch?v=QNb7gPA1JFk
That's pretty cool. :)
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

Derek wrote:
techjunkie wrote:Wow! Can't you do a "Beryl" clone for Windows? :wink:
http://wiki.beryl-project.org/wiki/Main_Page
http://www.youtube.com/watch?v=QNb7gPA1JFk
That's pretty cool. :)
Yeah! :D I'm installing Beryl and Ubuntu (Yes! Ubuntu! :twisted: ) at home right now - just to impress my friends... :lol: :lol:
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

I did it more simple, without the functions of SuperSprite3D from Cpl.Bator.
Now it is all pure native.
Anyway it could be improved still more coz of the z axis of Sprite3D is wierd for me.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

lol. :lol:

Just spotted this. Thought I lost control of my screen for a moment.

Cool stuff, Psycho!
Dare2 cut down to size
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

I liked the original code better, because once the screen tilted back to the
bottom, it didn't "disappear" for half a second like it does now. :P

Also, you've got some incorrect error-checking in your new code:

Code: Select all

If ExamineDesktops():Global SCREENWIDTH=DesktopWidth(0),SCREENHEIGHT=DesktopHeight(0)
Else:Global SCREENWIDTH=GetSystemMetrics_(#SM_CXSCREEN),SCREENHEIGHT=GetSystemMetrics_(#SM_CYSCREEN)
EndIf
If InitSprite()=0 Or InitSprite3D()=0 Or InitKeyboard()=0
  MessageRequester("Error","Can't access DirectX",0):End
EndIf
;SnapShot:
desktop.l = CreateImage(0,DesktopWidth(0),DesktopHeight(0))
The last line will cause an error if ExamineDesktops() fails at the top,
since you can't use DesktopWidth() and DesktopHeight() if it fails.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

PB wrote:I liked the original code better, because once the screen tilted back to the
bottom, it didn't "disappear" for half a second like it does now. :P

Also, you've got some incorrect error-checking in your new code:

Code: Select all

If ExamineDesktops():Global SCREENWIDTH=DesktopWidth(0),SCREENHEIGHT=DesktopHeight(0)
Else:Global SCREENWIDTH=GetSystemMetrics_(#SM_CXSCREEN),SCREENHEIGHT=GetSystemMetrics_(#SM_CYSCREEN)
EndIf
If InitSprite()=0 Or InitSprite3D()=0 Or InitKeyboard()=0
  MessageRequester("Error","Can't access DirectX",0):End
EndIf
;SnapShot:
desktop.l = CreateImage(0,DesktopWidth(0),DesktopHeight(0))
The last line will cause an error if ExamineDesktops() fails at the top,
since you can't use DesktopWidth() and DesktopHeight() if it fails.
Thats odd, just the opposite for me because on the orginal version for me when the screen tilted back it did "disappear" for a second, where the latest version doesn't do that to me.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Aaargh! you are right PB,
now is corrected.

About the screen dissappear, etc, you can play with the values in the line:

Code: Select all

Data.f 0.005,0.005,0.0045
:wink:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> About the screen dissappear, etc, you can play with the values in the line

I tried that but can't see how to fix it... the screen still lays too flat and is gone
for about half a second before rising up again. Any better tip to fix this?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Post Reply