Page 3 of 5

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

Posted: Sat Sep 03, 2005 1:09 pm
by THCM
Hi! Nice work guys! Hope to see some examples soon. What I'm missing is a command like Purebasic's ClipSprite. It's quite useful for animation-strips!

Keep on!

Posted: Sat Sep 03, 2005 1:56 pm
by djes
Badly, it seems that mouse functions aren't working anymore.
Do you think that we'll soon see rotation or scaling functions? :P And could you say me if refresh rate is working?

Posted: Sat Sep 03, 2005 6:01 pm
by Deeem2031
>What I'm missing is a command like Purebasic's ClipSprite. It's quite useful for animation-strips!

:arrow: 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? :P

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

>And could you say me if refresh rate is working?

None of the PB-Procs work together with this lib also RefreshRate()..

Posted: Sat Sep 03, 2005 6:08 pm
by djes
Thank you! :D

Posted: Sat Sep 03, 2005 7:20 pm
by va!n
@djes:
Many thanks! I am very glad to hear, you like the examples! :D

@THCM:
Many thanks THCM! :D 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 :D

Posted: Sun Sep 04, 2005 8:23 pm
by Joakim Christiansen
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! :wink:

Posted: Sun Sep 04, 2005 8:59 pm
by djes
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! :wink:
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.
The dll could be in the program folder or in windows/system32.

Posted: Sun Sep 04, 2005 8:59 pm
by Deeem2031
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...
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:And I also noticed the examples uses 100% cpu, that's scary.
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 where are we supposed to put the files? I just had to guess...
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:But it was a great lib, keep up the good work! :wink:
Thx :)

Posted: Sun Sep 04, 2005 9:02 pm
by djes
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... :)

Posted: Mon Sep 05, 2005 10:16 am
by djes
My computer doesn't like the #PB_D3D_CopyBuffer parameter in openscreen .
Is it really necessary?

Posted: Mon Sep 05, 2005 1:56 pm
by va!n
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! ;)

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  
; /************************************************************************** 

Posted: Mon Sep 05, 2005 2:06 pm
by va!n
djes wrote:My computer doesn't like the #PB_D3D_CopyBuffer parameter in openscreen .
Is it really necessary?
@djes:
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

Posted: Tue Sep 06, 2005 11:23 am
by va!n
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

Posted: Tue Sep 06, 2005 12:54 pm
by Num3
djes wrote:The dll could be in the program folder or in windows/system32.
I would advice the program folder, it's cleaner for you and the end user...