SpriteDX9 Lib - New release - v0.58

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Hey MrVain! I love your examples!!! :D
THCM
Enthusiast
Enthusiast
Posts: 276
Joined: Fri Apr 25, 2003 5:06 pm
Location: Gummersbach - Germany
Contact:

Post 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!
The Human Code Machine / Masters' Design Group
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post 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?
User avatar
Deeem2031
Enthusiast
Enthusiast
Posts: 216
Joined: Sat Sep 20, 2003 3:57 pm
Location: Germany
Contact:

Post 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()..
irc://irc.freenode.org/#purebasic
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Thank you! :D
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post 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
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post 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:
I like logic, hence I dislike humans but love computers.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post 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.
User avatar
Deeem2031
Enthusiast
Enthusiast
Posts: 216
Joined: Sat Sep 20, 2003 3:57 pm
Location: Germany
Contact:

Post 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 :)
irc://irc.freenode.org/#purebasic
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post 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... :)
Last edited by djes on Mon Sep 05, 2005 10:17 am, edited 1 time in total.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

My computer doesn't like the #PB_D3D_CopyBuffer parameter in openscreen .
Is it really necessary?
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post 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  
; /************************************************************************** 
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post 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
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post 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
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post 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...
Post Reply