Posted: Sat Sep 03, 2005 11:21 am
Hey MrVain! I love your examples!!! 

http://www.purebasic.com
https://www.purebasic.fr/english/
The dll is needed to decode pictures (with transparency). Without it, it would be necessary to recode all this stuff! It's possible but it will certainly take time.Joakim Christiansen wrote:It would'nt work without that dll file.
Could you make it so we don't need that?, no other DX stuff on my computer needs it...
And I also noticed the examples uses 100% cpu, that's scary.
And where are we supposed to put the files? I just had to guess...
But it was a great lib, keep up the good work!
Probably because the dll is to newer than your stuff. The first D3DX-DLL was released in feb. 2005. Since may 2005 its legal to include this dll in program packages, so for now there aren't many programs that use this files. But it becomes more and more. You will see, later everyone will use that because its simply easier to handle DX with that.Joakim Christiansen wrote:It would'nt work without that dll file.
Could you make it so we don't need that?, no other DX stuff on my computer needs it...
Insert a Delay() and it should be no problem anymore. But i think it isn't bad if games or grafik examples use all cpu.Joakim Christiansen wrote:And I also noticed the examples uses 100% cpu, that's scary.
I found that lib in my windows/system32 directory, so you maybe put them there to. All the other DirectX dlls are there, too.Joakim Christiansen wrote:And where are we supposed to put the files? I just had to guess...
ThxJoakim Christiansen wrote:But it was a great lib, keep up the good work!
Code: Select all
; /*************************************************************************************
; / Small Font Example by Mr.Vain of Secretly! (Thorsten Will) & Deeem2031
; / Demonstrating the using of SpriteDX9 v0.57+ by Deeem2031
; /
; / 05-September-2005 / Load Font and how to define the argument "weight" v0.1
; /*************************************************************************************
InitSpriteDX9()
InitKeyboard()
; -------- Run Windowed/FullScreen Mode? and Open DirectX9 Screen --------
lResult = MessageRequester("Please select:","Run example in FullScreen mode?",#PB_MessageRequester_YesNo)
If lResult = #PB_MessageRequester_No ; User pressed NoButton
lMode = #PB_D3D_Windowed|#PB_D3D_AlphaBlending|#PB_D3D_AntiAliasing4
hScreen = OpenScreenDX9(800,600,32,OpenWindow(0,0,0,800,600,#PB_Window_ScreenCentered|#PB_Window_SystemMenu,"SpriteDX9 Example"),lMode)
Else ; User pressed YesButton
lMode = #PB_D3D_AntiAliasing4 |#PB_D3D_AlphaBlending
hScreen = OpenScreenDX9(800,600,32,"SpriteDX9 Example",lMode)
EndIf
If hScreen = 0
MessageRequester("Error","Cant open DirectX9 Screen",0)
End
EndIf
; -------- Load Fonts and define ints weitgh --------
#FW_THIN = 100
#FW_NORMAL = 400
#FW_BOLD = 700
#FW_HEAVY = 900
hFont0 = LoadFontDX9("Arial", 64, 40, #FW_THIN)
hFont1 = LoadFontDX9("Arial", 64, 40, #FW_NORMAL)
hFont2 = LoadFontDX9("Arial", 64, 40, #FW_BOLD)
hFont3 = LoadFontDX9("Arial", 64, 40, #FW_HEAVY)
; -------- MainLoop --------
Repeat
ClearScreenDX9(RGBA(0,0,100,0))
StartDX9()
DrawTextDX9(hFont0,"DrawText Thin" ,20, 20,800,600,RGBA($FF,$FF,$FF,$FF))
DrawTextDX9(hFont1,"DrawText Normal",20,120,800,600,RGBA($FF,$FF,$FF,$FF))
DrawTextDX9(hFont2,"DrawText Bold" ,20,220,800,600,RGBA($FF,$FF,$FF,$FF))
DrawTextDX9(hFont3,"DrawText Heavy" ,20,320,800,600,RGBA($FF,$FF,$FF,$FF))
StopDX9()
FlipBuffersDX9()
DisableDebugger
; -------- Check Window Events --------
lEvent.l = WindowEvent()
While lEvent
If lEvent = #PB_Event_CloseWindow
wQuit.w = 1
EndIf
lEvent = WindowEvent()
Wend
; -------- Check if ESCAPE pressed --------
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape) Or wQuit
EnableDebugger
; -------- Quit and free all Stuff --------
FreeFontDX9(hFont0)
FreeFontDX9(hFont1)
FreeFontDX9(hFont2)
FreeFontDX9(hFont3)
CloseScreenDX9()
End
; /EOL
; /**************************************************************************
@djes:djes wrote:My computer doesn't like the #PB_D3D_CopyBuffer parameter in openscreen .
Is it really necessary?
Code: Select all
hFont = LoadFontDX9(Fontname.s, Height, Width, Weight)
#FW_DONTCARE = 0
#FW_THIN = 100
#FW_EXTRALIGHT = 200
#FW_LIGHT = 300
#FW_NORMAL = 400
#FW_MEDIUM = 500
#FW_SEMIBOLD = 600
#FW_BOLD = 700
#FW_EXTRABOLD = 800
#FW_HEAVY = 900
I would advice the program folder, it's cleaner for you and the end user...djes wrote:The dll could be in the program folder or in windows/system32.