PurePunch Contest #2

Share your advanced PureBasic knowledge/code with the community.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

Updated version - iFX v2:
Fixed some bugs! Just take a look to the original post at http://www.purebasic.fr/english/viewtop ... 873#290873 ... thx
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Post by Demivec »

@va!n: iFX v2 doesn't seem to do anything when the rightmost trackbar is used.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

@Demivec:
yes i know... it seems to happens only for 24 bit images... i have no idea why does this happens and whats wrong with the code nor how to fix it...

please read the info in the header ^^ anyway thx for feedback ;)
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

SETI finally finds evidence of ET, planet of the axe apes!
how they built a radio or got hold of axe guitars and overdrives on their amps we'll never know!

Tune in stick cheese in ears!

Code: Select all


;*****************************************************************************
;*
;* Name   :SETI Finally finds evidence of ET
;* Author :idle - andrew ferguson
;* Date   :29/06/2009
;* Notes  :windows only tested on XP!!!!
;*****************************************************************************
Structure WTF:T.w:c.w:ns.l:ab.l:nb.w:bs.w:cb.w:EndStructure
Global FP,wf.WTF,wh.WAVEHDR,hw.i,sz=44100*300,*w=AllocateMemory(sz),t2.i   
Procedure WOP(h,u,d,a,b):If u=#WOM_DONE:FP=1:EndIf:EndProcedure
wf\T=1:wf\C=2:wf\bs=16:wf\nS=44100:wf\nb=2:wf\ab=176400:wh\lpData=*w
wh\dwBufferLength=sz:waveOutOpen_(@hW,-1,wf,@WOP(),0,$30000):FP=0:ft=1000
waveOutPrepareHeader_(hw,wh,SizeOf(wh)):While i<sz/9:v+ft:v%32767:PokeW(*w+i,v)
Ft+Tan(i):i+2:Wend:t1=GetTickCount_():While i<sz-2:t2=GetTickCount_()-t1
t=i%((t2%2700)+700):v=Sin(t)*ft:v%32767:PokeW(*w+i,v):Ft+Tan(i*3)
i+2:Wend:waveOutWrite_(hw,wh,SizeOf(wh)):While Not FP:Delay(10):Wend
waveOutUnprepareHeader_(hw,wh,SizeOf(wh)):waveOutClose_(hw):FreeMemory(*w) 
Last edited by idle on Mon Jun 29, 2009 11:53 am, edited 3 times in total.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

@idle:
sorry... here at Win7 i dont hear anything when compiling as x86 nor as x64 version :(
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

don't see why not, there was a 3 second delay in the second version, removed it now
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Idle> Kewl! 8)
rrpl
Enthusiast
Enthusiast
Posts: 121
Joined: Fri Apr 18, 2008 7:22 am
Location: Australia

Post by rrpl »

A late stage entry. An example of an 'art' clock. :)

Code: Select all

;*****************************************************************************
;*
;* Name   : Art Clock
;* Author : rrpl 
;* Date   : 30 June 09
;* Notes  : Well yes it a clock - 'art' is timed to the seconds count
;*
;***************************************************************************** 
l=200:m=100:W=OpenWindow(0,200,200,l,m,"Art Clock",$CC0001):InitSprite()
OpenWindowedScreen(W, 0,0, l, m, 1, 0, 0):SetTimer_(W,1,1000,0):Procedure z(v)
v=Random(v):ProcedureReturn v:EndProcedure:Procedure a():g=z(24):h=z(18)
x=z(200-g):y=z(170-h):b=z(255):g=z(255):r=z(255):Ellipse(g,h,x,y,RGB(r,g,b))
EndProcedure:Procedure u(f):For k=0 To f:a():Next:EndProcedure
ClearScreen($bbbbbb):Repeat:n=Date():e=WaitWindowEvent():If e= 16:End
ElseIf e=#WM_TIMER:If EventwParam()=1:d.s=FormatDate("%dd/%mm/%yyyy",n)
t.s=FormatDate("%hh:%ii:%ss",n):StartDrawing(ScreenOutput()):u(1)
Box(40,30, 120, 37 ,$FFFFFF):DrawText(40,30," Date: "+d):
DrawText(40,50," Time: "+t+" "):StopDrawing():EndIf:EndIf:FlipBuffers():ForEver
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Nice. Colorful. Compact.

Thumbs up
Ollivier
Enthusiast
Enthusiast
Posts: 281
Joined: Mon Jul 23, 2007 8:30 pm
Location: FR

Post by Ollivier »

You can vote here.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Results have been published on the first post : http://www.purebasic.fr/english/viewtopic.php?p=287769
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

Congratulations to Hades (1st place), RocketRider (3rd place) and to all other contributors! ;)
Btw thanks for voting my entry to the 2nd place!
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Post Reply