
SpriteDX9 Lib - New release - v0.58
>What I'm missing is a command like Purebasic's ClipSprite. It's quite useful for animation-strips!
Todolist
>Badly, it seems that mouse functions aren't working anymore.
Yea, here the same problem, maybe the mouse procedures don't like my lib
I'll create a DirectInput-library when i finished the 2D procedures of this lib, then it should work. A little example of directInput i already posted in the german forum: http://forums.purebasic.com/german/viewtopic.php?t=4487
>Do you think that we'll soon see rotation or scaling functions?
It already works here, i just have to make the procs PB-User compatible
>And could you say me if refresh rate is working?
None of the PB-Procs work together with this lib also RefreshRate()..

>Badly, it seems that mouse functions aren't working anymore.
Yea, here the same problem, maybe the mouse procedures don't like my lib

I'll create a DirectInput-library when i finished the 2D procedures of this lib, then it should work. A little example of directInput i already posted in the german forum: http://forums.purebasic.com/german/viewtopic.php?t=4487
>Do you think that we'll soon see rotation or scaling functions?

It already works here, i just have to make the procs PB-User compatible

>And could you say me if refresh rate is working?
None of the PB-Procs work together with this lib also RefreshRate()..
irc://irc.freenode.org/#purebasic
@djes:
Many thanks! I am very glad to hear, you like the examples!
@THCM:
Many thanks THCM!
You will find three small examples showing you how to use the commands of SpriteDX9, build in up to v0.56! Atm i am working on new/modified examples for the next release(s)! Btw, i agree with the ClipSprite() stuff... but afaik this is on the todo list 
@Deeem2031:
Keep on your great work and stay cool! Catch you later, bye
Many thanks! I am very glad to hear, you like the examples!

@THCM:
Many thanks THCM!


@Deeem2031:
Keep on your great work and stay cool! Catch you later, bye

va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
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!
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!

I like logic, hence I dislike humans but love computers.
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!
The dll could be in the program folder or in windows/system32.
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!

irc://irc.freenode.org/#purebasic
If I remember, in C the functions of a static library are included in the program. So this dll are in all these programs, not in a file, but included... 

Last edited by djes on Mon Sep 05, 2005 10:17 am, edited 1 time in total.
hFont = LoadFontDX9(Fontname.s, Height, Width, Weight)
LoadFontDX9() require a value for the argument Weight! But in the CHM file isnt any info about this atm (this will be fixed)! So i will poste a very small example showing you how to set the Weight value!
LoadFontDX9() require a value for the argument Weight! But in the CHM file isnt any info about this atm (this will be fixed)! So i will poste a very small example showing you how to set the Weight value!

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
; /**************************************************************************
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
@djes:djes wrote:My computer doesn't like the #PB_D3D_CopyBuffer parameter in openscreen .
Is it really necessary?
Afaik, you must not use #PB_D3D_CopyBuffer!! You can use any kind you wish... for example you can do it with TribleBuffering too!? But i think CopyBuffer will be DoubleBuffering and i think it should work without problems!? Maybe Deeem2031 can help you... i will inform him about this

#PB_D3D_TribleBuffering
#PB_D3D_AlphaBlending
#PB_D3D_CopyBuffer
#PB_D3D_AntiAliasing
#PB_D3D_AntiAliasing2
#PB_D3D_AntiAliasing3
#PB_D3D_AntiAliasing4
#PB_D3D_Windowed
#PB_D3D_Software
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
this should be the complete list of the "Weight" arguments with LoadFontDX9() ...!?
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
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,