Results 1 to 15 of 15

Thread: [RESOLVED] Use DX9 with VB6!

  1. #1

    Thread Starter
    Addicted Member Mikle's Avatar
    Join Date
    Oct 2009
    Location
    Tuapse, Russia
    Posts
    138

    Resolved [RESOLVED] Use DX9 with VB6!

    Look at my port for DX9 with VB6:

    Here my dll, port (moduls and classes), some tutorials and shader compiler.
    Only shader compiler need d3dx9_37.dll, but you program with shaders not need this!
    It is worked in XP, Vista and Windows7.
    Demo:

    This demo need PS2_0.
    All this free for use.

    Links removed.
    All links in post 14!
    Last edited by Mikle; Nov 11th, 2011 at 12:53 AM.

  2. #2
    Lively Member
    Join Date
    Aug 2008
    Location
    Denmark
    Posts
    85

    Re: Use DX9 with VB6!

    Awesome Mikle!

    Very good job and some nice examples, now everyone in vb6 can play with dx9!

    People interested in a similar technique (with a closed source wrapper DLL) but the full interface could look at Ron van Tilburg excelent stuff which is different from Mikle's because it exposes the entire dx9 API via a typelib - But it also requires the use of a wrapper DLL http://www.Planet-Source-Code.com/vb...59767&lngWId=1. Tip look also at his other projects for advanced examples of use - some are really really cool.

    One or the reasons why Mikle's solution might be preferred is that it's free for commercial uses (as is my 2D game engine (dxICE) which also use DirectX)
    For commercial usages you need to ask Ron van Tilburg for a deal if you use his stuff.
    Another serious down side is that van Tilburgs solution might not be maintained.
    Both van Tilburgs wrapper and Mikle's dx_vb.dll are without source code but it's the same with dx ICE

    Among the price paid for not using the dxd3_xxx.dll is that it seems to use GDI Plus to load textures or you will have to load them yourself.
    I'm not sure if you have full control of Texture pools or if they all just end in managed pool with this solution but it creating a rendertarget texture (more than the default) could be a problem and also copy between textures.
    Another issue is lack of DirectInput. This is not a problem with simple key strokes but for an action game it might be.

    Anyway - All in all I would think Mikle's solution is better than van Tilburgs if you want to play with the dx9 api, because you can use it freely.

    Congratulations - Well done Mikle - thanks for sharing

  3. #3

    Thread Starter
    Addicted Member Mikle's Avatar
    Join Date
    Oct 2009
    Location
    Tuapse, Russia
    Posts
    138

    Re: Use DX9 with VB6!

    Thank you for the detailed feedback!
    I was looking at options wrappers, but came to use ActiveX DLL not because they do not create further problems for the registration of users, not having the status of admin.
    This is not an attempt to complete the transfer interface DirectX, this is only part, which I considered necessary for simple games. To download the texture is really used GDI +, this part is supplied in source code form, and if desired can be completed yet or even converted to another vehicle.
    I do not prescribe DirectInput, because to use the keyboard and mouse felt quite sufficient funds VB6, maybe I am wrong.
    In general, this is not a finished work, I keep it to expand, but to use it is already possible.

  4. #4
    Lively Member
    Join Date
    Aug 2008
    Location
    Denmark
    Posts
    85

    Re: Use DX9 with VB6!

    About directinput you might be right. I agree that for the simpler games your method is simpler and sufficient.
    Will it be possible to create textures and surfaces using the d3dx_xxx.dll's and attach them to the texture pointer ptr - like you are doing with the gdi?
    What if those textures are created on the graphics card in the Direct Pool?
    From what it looks now all textures will be in sysmem - correct?

  5. #5

    Thread Starter
    Addicted Member Mikle's Avatar
    Join Date
    Oct 2009
    Location
    Tuapse, Russia
    Posts
    138

    Re: Use DX9 with VB6!

    Now the texture is not created, but only loaded using GDI +. They are created using Direct3D, but not D3DX!. Function CreateTextureFromFile really creates only SystemMem texture. In the future, I plan to expand this feature, but do not want to use D3DX.
    But now we can to create a texture with Direct3DDevice9.CreateTexture any Pool and Usage.

  6. #6

    Thread Starter
    Addicted Member Mikle's Avatar
    Join Date
    Oct 2009
    Location
    Tuapse, Russia
    Posts
    138

    Re: Use DX9 with VB6!


  7. #7
    Lively Member
    Join Date
    Aug 2008
    Location
    Denmark
    Posts
    85

    Re: Use DX9 with VB6!

    Another Awesome example.. hehe microsoft will never get rid of vb6 now

    (when signing a partician and shouting in their faces won't work.. just call Mikle he will code their butts off and show us the way.. most excellent if you ask me )

    Good Job man

  8. #8
    Lively Member
    Join Date
    Aug 2008
    Location
    Denmark
    Posts
    85

    Talking Use DX9 with VB6! - now calling any d3dx9 version :)

    The source code is Mikle's water render example with this addition.
    Mikle's example uses GDIPlus to load the image and memory copies to the texture which means it stays in System Mem (and the program depends on GDIPlus).

    One of the drawbacks with this technic was that some of the most convenient functions are in the D3DX9_XX dlls.
    However since we dont know which dll is on the machine we cannot just declare the API.

    I have made a way to call any of the D3DX9 API methods and in this example I have implemented a call to D3DX9CreateTextureFromFile.

    The new code added to this example is cD3DX9.cls and cFuncCall.cls (used only by cD3DX9.cls) and all code is in VB6.

    cD3DX9.InitD3DX method attempts to load any of these versions
    D3DX9_43.DLL, D3DX9_42.DLL, D3DX9_39.DLL, D3DX9_35.DLL D3DX9_24.DLL
    You can easily add more if you like but generally you might want to control which DLLs is loaded.

    Property D3DXName returns the name of the loaded dll.

    and then I have added the common CreateTextureFromFile in the format we used in dx8vb only know returning a Direct3dTexture9
    Public Function CreateTextureFromFile(d3dDev As Direct3DDevice9, fName As String) As Direct3DTexture9

    Source:
    Water_withDynamicD3DX9_v1.zip

    Note: I did not implement a substitution for Loading the VolumeTextures but that should be fairly straight forward and I leave it as an excercise for the currious minds

    Enjoy

  9. #9

    Thread Starter
    Addicted Member Mikle's Avatar
    Join Date
    Oct 2009
    Location
    Tuapse, Russia
    Posts
    138

    Re: Use DX9 with VB6!

    Using GDI+ does not mean that the resulting texture will necessarily SystemMem. I'm working on analog CreateTextureFromFileEx.
    And what will be dependent on GDI+, a problem I do not think - because GDI+ is initially everywhere, from WindowsXP and next, can not be said about D3DX9_XX.DLL.

    I appreciated the trick with Dynamic Calls!
    But it may better make another DLL, which uses a particular version D3DX, and recommend to complete the program full distribution SDK runtime (it's legal). This is for larger projects, and for small to recommend using the original version without D3DX.

  10. #10

    Thread Starter
    Addicted Member Mikle's Avatar
    Join Date
    Oct 2009
    Location
    Tuapse, Russia
    Posts
    138

    Re: Use DX9 with VB6!

    I solved the problem with D3DX simple - use the SDK Oct 2004, there D3DX linked against statically.
    Here is a new port, so far without tutorials:
    http://tuapse-mikle.narod.ru/dx_vb/new_dx_vb.zip

  11. #11
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Use DX9 with VB6!

    Glad you managed to solved the problem!v Please mark the thread "Resolved" if you have finished with the thread.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  12. #12

    Thread Starter
    Addicted Member Mikle's Avatar
    Join Date
    Oct 2009
    Location
    Tuapse, Russia
    Posts
    138

    Re: [RESOLVED] Use DX9 with VB6!

    Nightwalker83
    Ok!
    This thread was not originally contained the problem is - the announcement.

  13. #13
    New Member
    Join Date
    Oct 2011
    Posts
    10

    Question Re: [RESOLVED] Use DX9 with VB6!

    can anyone give me a link to all files posted by Mikle please? Every link he posted not working anymore

    Thank's

  14. #14

    Thread Starter
    Addicted Member Mikle's Avatar
    Join Date
    Oct 2009
    Location
    Tuapse, Russia
    Posts
    138

    Re: [RESOLVED] Use DX9 with VB6!

    This is the latest version of the engine:
    http://mikle.ucoz.com/load/0-0-0-7-20
    Last edited by Mikle; Sep 14th, 2013 at 05:16 AM.

  15. #15
    New Member
    Join Date
    Oct 2011
    Posts
    10

    Thumbs up Re: [RESOLVED] Use DX9 with VB6!

    Thank's Mikle, you are very helpfull

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width