dcsimg
Page 2 of 2 FirstFirst 12
Results 41 to 53 of 53

Thread: [VB6] Direct3D9.

  1. #41
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,801

    Re: [VB6] Direct3D9.

    Quote Originally Posted by xman2000 View Post
    Hi, TheTrick

    is awesome this 3D9 libary, you like make this entire in VB6 ? why?
    Hi xman2000,

    I've got no idea what motivates The Trick, as I've got little idea what motivates myself. However, I'm sure glad that The Trick was willing to share this work. I've used it in several of my own VB6 projects. Here's a C3D mocap reader I've posted on the CodeBank that uses it. I've also used it in several other contexts.

    Take Care,
    Elroy
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  2. #42
    Lively Member
    Join Date
    Jun 2016
    Posts
    86

    Re: [VB6] Direct3D9.

    Quote Originally Posted by Elroy View Post
    Hi xman2000,

    I've got no idea what motivates The Trick, as I've got little idea what motivates myself. However, I'm sure glad that The Trick was willing to share this work. I've used it in several of my own VB6 projects. Here's a C3D mocap reader I've posted on the CodeBank that uses it. I've also used it in several other contexts.

    Take Care,
    Elroy
    Hi Elroy,
    this 3D9 libray is a greate work, greate project, and not problem if closed source-code, only i need some time use pure vb6 and i like to find in the web a pure vb6 library like this 3D9.

    My intention not is find the library only by algorithms but to pradronize the code, and se Library is big i use like external compiled file, but if the codes i need is small i use only few codes of library to my project, or rebuild the library into small libraries but with same pradronized code, to avoid bugs, to make more easy understand.

    only is a question to know the plans of the autor and possible difficulties to implement this idea.


    cheers.
    Last edited by xman2000; Dec 23rd, 2018 at 10:41 AM.

  3. #43
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,801

    Re: [VB6] Direct3D9.

    Quote Originally Posted by xman2000 View Post
    this 3D9 libray is a greate work, greate project, and not problem if closed source-code, only i need some time use pure vb6 and i like to find in the web a pure vb6 library like this 3D9.
    Hi Xman,

    Everything about The Trick's work is open-source. I'm not sure what you mean by closed-source?!

    He provided many linear algebra procedures (in VB6 open-source source-code). But the main thing he provides is the DX9VB.tlb TypeLib, which allows VB6 to interface with the DirectX3D library built into Windows. And this DX9VB.tlb is easily open-source as well. Here, I've attached the IDL file for your perusal (see attached ZIP).

    Now, you say "pure VB6". This is about as pure VB6 as it gets. Do you want to do all the DirectX3D graphics functions in VB6 code? If so, that's sort of insane because the DirectX technology interfaces directly with the GPU (graphics processing unit) of your hardware to do its work. Sure, you could write your own procedures with the graphics statements of a PictureBox (or a Form), but they'd be MUCH slower than anything using DirectX. Without DirectX (or some other similar technology, such as the stuff that uses OpenGL), you're not interfacing directly with the GPU. That's the whole reason for DirectX.

    Now, if you want the TypeLib out of the picture (and there's really no reason for that), you could drop back to DirectX8, which is directly COM compatible. Also DirectX8 uses StdCall, which allows for API declarations directly in the VB6 source code, and no need for a TypeLib. But again, what's wrong with a TypeLib?

    The DirectX9 just comes with all recent versions of Windows, which is very convenient. However, to use DirectX8, you'll have to find a copy of the dx8vb.dll, and distribute it with your application.

    Good Luck,
    Elroy
    Attached Files Attached Files
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  4. #44
    Lively Member
    Join Date
    Jun 2016
    Posts
    86

    Re: [VB6] Direct3D9.

    Hi, Elroy,

    yes, i like "Do you want to do all the DirectX3D graphics functions in VB6 code? If so, that's sort of insane"

    not problem if is more slow, only if works very well.

    "Now, if you want the TypeLib out of the picture"
    i not understand "out of the picture" but i like the TypeLib in pure vb6 inside the project like a module .bas, or class or .frm but i need not use files.

    in some times i use external files, .dll, .ocx, but other times i like use only vb6 code and others with apis.

    i understand you speak this Libarry is to DirectX interaction, i I had imagined that something like this already existed, and that this library was a little (little and simple) substitute for Directx and people can add more features.

    "you're not interfacing directly with the GPU"
    yes, we can make a 3D Library replacement of Directx more simple with not GPU and other version of the 3D library with GPU.

    What would we need to do to create a GPU version?
    there would be a need to create compatibility for the drivers of each VGA GPU device of each company?
    eu can stop this subject not to flood this thread.

    not problem if is more slow, only if works very well and not uses external files or external ressources, the most compatible and universal is better for some uses.

    like this idea: have a 3D libray in pure VB6 i can put all code inside the vb project an re-use all functions and rebuild the big library into small libraries to especific purposes and can padronize the codes i use in image processing, and can add more features, more algorithms like scientific and image vision, medical, etc.

    edit:it is not always necessary that the performance be very fast as for games at 60fps, it can be slow if it is only to visualize an object or a scenario observing the details, but perhaps to edit objects and see the changes in a reasonable speed a non- GPU library I do not know if it will.


    edit2: but if we can but use the GPU but with everything written in VB6 with total replacement of Directx or OpenGL would be very good, even if it is a little slower than them.

    This 3D9 library by TheTrick is greate and is specific to DirectX, greate!
    I was not sure if it was this or a replacement. Now i know.
    Last edited by xman2000; Dec 23rd, 2018 at 12:29 PM.

  5. #45
    New Member
    Join Date
    Mar 2019
    Posts
    2

    Re: [VB6] Direct3D9.

    How about this? im using this source code but I cant load pictures from memory. Thanks.

  6. #46

  7. #47
    New Member
    Join Date
    Mar 2019
    Posts
    2

    Re: [VB6] Direct3D9.

    Hi The trick! Thanks for replying.

    Im trying to load a PNG file in memory directly into DX9, I used the D3Dx.CreateTextureFromFileInMemoryEx but I cannot find it in your typelib. Thanks.

  8. #48

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2015
    Posts
    1,360

    Re: [VB6] Direct3D9.

    Quote Originally Posted by Barrin View Post
    Hi The trick! Thanks for replying.

    Im trying to load a PNG file in memory directly into DX9, I used the D3Dx.CreateTextureFromFileInMemoryEx but I cannot find it in your typelib. Thanks.
    There is no this function in the type library. You could load a picture using GDI+ and using the bits of the picture to initialize texture IDirect3DTexture9.LockRect (see the prjCubeDemo).

  9. #49
    New Member
    Join Date
    Oct 2019
    Posts
    3

    Re: [VB6] Direct3D9.

    Hi all,

    I need your help

    My problem: two textures; one for background (image from hd), the other one with a lot of text (with vertex), black background, and text color random.

    I need to make transparent only the black background, not alpha the text (must be completly opaque)Name:  Schermata del 2019-10-17 10-25-13.jpg
Views: 76
Size:  33.9 KB

    This is my code:

    ' // Apply texture Background
    d3dev.SetTexture 0, texture
    d3dev.DrawPrimitive D3DPT_TRIANGLELIST, 0, 2

    ' // Remove texture
    d3dev.SetTexture 0, Nothing
    d3dev.SetTexture 0, textureText

    d3dev.SetRenderState D3DRS_ALPHABLENDENABLE, 1
    d3dev.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCCOLOR
    d3dev.SetRenderState D3DRS_DESTBLEND, D3DBLEND_DESTCOLOR
    d3dev.SetRenderState D3DRS_BLENDOP, D3DBLENDOP_ADD
    d3dev.SetRenderState D3DRS_BLENDOP, D3DBLENDOP_ADD


    ' // Draw background
    d3dev.DrawPrimitive D3DPT_TRIANGLELIST, 6, 2
    d3dev.SetTexture 0, Nothing
    d3dev.EndScene

    d3dev.Present ByVal 0, ByVal 0, 0, ByVal 0


    Thanx in advance.

    Ciao.
    L.

  10. #50
    New Member
    Join Date
    Oct 2019
    Posts
    3

    Re: [VB6] Direct3D9.

    Hi all,

    I need your help

    My problem: two textures; one for background (image from hd), the other one with a lot of text (with vertex), black background, and text color random.

    I need to make transparent only the black background, not alpha the text (must be completly opaque)Name:  Schermata del 2019-10-17 10-25-13.jpg
Views: 76
Size:  33.9 KB

    This is my code:

    ' // Apply texture Background
    d3dev.SetTexture 0, texture
    d3dev.DrawPrimitive D3DPT_TRIANGLELIST, 0, 2

    ' // Remove texture
    d3dev.SetTexture 0, Nothing
    d3dev.SetTexture 0, textureText

    d3dev.SetRenderState D3DRS_ALPHABLENDENABLE, 1
    d3dev.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCCOLOR
    d3dev.SetRenderState D3DRS_DESTBLEND, D3DBLEND_DESTCOLOR
    d3dev.SetRenderState D3DRS_BLENDOP, D3DBLENDOP_ADD
    d3dev.SetRenderState D3DRS_BLENDOP, D3DBLENDOP_ADD


    ' // Draw background
    d3dev.DrawPrimitive D3DPT_TRIANGLELIST, 6, 2
    d3dev.SetTexture 0, Nothing
    d3dev.EndScene

    d3dev.Present ByVal 0, ByVal 0, 0, ByVal 0


    Thanx in advance.

    Ciao.
    L.

  11. #51

  12. #52
    New Member
    Join Date
    Oct 2019
    Posts
    3

    Re: [VB6] Direct3D9.

    Quote Originally Posted by The trick View Post
    Use additive blending (see Fire example demo).
    Hi Trick, first of all thank you (sorry for delay).

    I saw the fire example, but maybe isn't what i'm looking for. My problem is that the second texture (the one with the text only) must be opaque (with black background completly transparent):

    - texture 0: a random image from file
    - texture 1: opaque text (background is black)

    Is possibile?

    PS: As you can see, I'm not an expert of DirectX

    Thank you again.

    Ciao.
    L.

  13. #53

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width