This is what I'm doing .
Code: Select all
ExamineKeyboard()
If KeyboardPushed(#PB_Key_D)
End
Endif
is there some thing I am not aware of .
I'm using PureBasic 5.73
I'm on a hp laptop 16gb 128gb and upto 3.4 ghz
Any ideas
Thanks for reading
Code: Select all
ExamineKeyboard()
If KeyboardPushed(#PB_Key_D)
End
Endif
Code: Select all
InitEngine3D()
InitSprite()
InitKeyboard()
OpenScreen(1,1,32,"take1")
OpenWindow(5,50,50,600,500,"take2")
SetFrameRate(60)
SetWindowColor(5,RGB(0,250,0))
RenderWorld()
timer1=1
timer2=24
starter:
timer1=timer1+1
timer2=timer2+1
StartDrawing(WindowOutput(5))
DrawText(timer1,timer2,"hello world",#Red,RGB(0,250,0))
DrawText(325,275,"excel",#Red,#Green)
StopDrawing()
If timer1>= 599
timer1=1
EndIf
If timer2>=499
timer2=1
EndIf
ExamineKeyboard()
If KeyboardPushed(#PB_Key_H)
CloseWindow(5)
CloseScreen()
EndIf
If WindowEvent()=#PB_Event_CloseWindow
CloseWindow(5)
CloseScreen()
EndIf
FlipBuffers()
Goto starter
Code: Select all
InitEngine3D()
InitSprite()
InitKeyboard()
;OpenScreen(1,1,32,"take1")
OpenWindow(5,50,50,600,500,"take2")
OpenWindowedScreen(WindowID(5), 0, 0, 1, 1)
SetFrameRate(60)
SetWindowColor(5,RGB(0,250,0))
RenderWorld()
timer1=1
timer2=24
;starter:
Repeat
timer1=timer1+1
timer2=timer2+1
StartDrawing(WindowOutput(5))
DrawText(timer1,timer2,"hello world",#Red,RGB(0,250,0))
DrawText(325,275,"excel",#Red,#Green)
StopDrawing()
Repeat
event = WindowEvent()
If WindowEvent()=#PB_Event_CloseWindow
CloseWindow(5)
CloseScreen()
End
EndIf
Until event = 0
If timer1>= 599
timer1=1
EndIf
If timer2>=499
timer2=1
EndIf
ExamineKeyboard()
If KeyboardPushed(#PB_Key_H)
CloseWindow(5)
CloseScreen()
End
EndIf
Delay(1) ;turn over remaining time slice for other programs running on OS
FlipBuffers()
;Goto starter
ForEver
Code: Select all
Structure main
w.I[1]
h.I[1]
screenSprite.I
*video
angle.F
EndStructure
Procedure Elapsed()
t = 240000 - ElapsedMilliseconds()
If t < 0
End
EndIf
ProcedureReturn t
EndProcedure
Define *this.main = AllocateMemory(SizeOf(main) )
With *this
InitSprite()
InitKeyboard()
InitMouse()
ExamineDesktops()
\w[0] = DesktopWidth(0)
\h[0] = DesktopHeight(0)
OpenScreen(\w[0], \h[0], 32, "", #PB_Screen_SmartSynchronization, DesktopFrequency(0) )
\screenSprite = CreateSprite(#PB_Any, 320, 200, #PB_Sprite_AlphaBlending)
ZoomSprite(\screenSprite, \w[0], \h[0] )
\angle = 0.0
Repeat
t0 = t
t = Elapsed()
delta = 16 - (t - t0)
If delta < 1
delta = 1
EndIf
If delta > 17
delta = 17
EndIf
Delay(delta)
t = Elapsed()
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
j + 1
If StartDrawing(SpriteOutput(\screenSprite) )
\video = DrawingBuffer()
For i = 0 To 63999
x = i % 320
y = i / 320
dx = 160 - x
dy = 100 - y
c = Sqr(dx*dx+ dy*dy) * (t / 1000)
df.d = Pow(ATan2(-dy, dx), 2) * (t / 100)
c + df
c & 255
If c < 128 + 64
c = 0
Else
If c < 128 + 64 + 16
c = RGB(0, 255, 255)
Else
If c < 128 + 64 + 32
c = RGB(0, 0, 255)
Else
If c < 128 + 64 + 48
c = RGB(0, 255, 0)
Else
c = RGB(255, 0, 0)
EndIf
EndIf
EndIf
EndIf
PokeL(\video + i << 2, c)
Next
StopDrawing()
EndIf
ClearScreen(0)
SpriteQuality(0)
DisplaySprite(\screenSprite, 0, 0)
If StartDrawing(ScreenOutput() )
DrawText(0, 0, Hex(t) )
StopDrawing()
EndIf
FlipBuffers()
ForEver
EndWith