Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Dark Basic Pro and VB

Author
Message
That Guy John
16
Years of Service
User Offline
Joined: 30th Apr 2010
Location: United States
Posted: 1st Mar 2012 00:12
Is it possible to use DBPro to create a control to use in a VB windows form?

I would like to use DBPro to create a 3D ViewPort that could be used in a winform.

If this is possible, could someone point me in the right direction to do this?

And Here Is A Penguin:
FPSC OneSource [DeskTop App] - Bringing everything together into one.
Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 1st Mar 2012 07:48
I don't actually know the answer to that question but it might be worth looking into DarkGDK.net.

Alien002
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 1st Mar 2012 07:50 Edited at: 1st Mar 2012 07:52
From my days in VB i think that is not possible. You want to use db to handle the grphics in VB. you need to learn directx / opengl to handle 3d graphics in vb.

edit i fogot about darkgdk.
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 1st Mar 2012 09:43
DarkGDK.NET should be able to help you out on that score.


Seppuku Arts
Moderator
21
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 1st Mar 2012 11:03 Edited at: 1st Mar 2012 11:03
If it's just the GUI you want to take advantage of, there's also some GUI plugins for DBP. Otherwise, DGDK.Net as others have already said.


DarkDISCUSSION
15
Years of Service
User Offline
Joined: 6th Jul 2011
Location: Ft Madison, IA
Posted: 1st Mar 2012 21:10 Edited at: 1st Mar 2012 21:15
Quote: "some GUI plugins for DBP"

I recommend that BBB GUI stuff found here:
http://forum.thegamecreators.com/?m=forum_view&t=162825&b=8
I also vote for the DarkGDK.NET if you still aren't satisfied.

Monsters are Ready to spill their Dark Sercrets......
That Guy John
16
Years of Service
User Offline
Joined: 30th Apr 2010
Location: United States
Posted: 2nd Mar 2012 02:24
I have thought about gdk.net , but from my understanding even after purchasing it I would need an upgraded license to sell anything made with it. I really don't see that being feasible just to get one control.

As for DX, I cannot for the life of me get any of my own 3d viewports working in vb. I have found samples, but when creating my own, I run into all sorts of problems.

And Here Is A Penguin:
FPSC OneSource [DeskTop App] - Bringing everything together into one.
The Weeping Corpse
14
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 2nd Mar 2012 13:06
I cant give all the info in one post but I'm in the process of doing this in Delphi. I'm creating a 3D modeling app in Delphi and using DB pro for the 3D viewport, complete with DB shaders DB lights etc.

You can use the windows API setparent function to move the DB pro window off the desktop and position it inside your VB app. the VB app doesnt own the window as such, it just appears inside it, it acts as a container. When the VB app is minimized the DB pro window will get hidden, when your VB app is restored the DB pro window will get restored.

You need to use some kind of IPC between the DB app and VB app. I dont know if you can hook into the VB WndProc but if you can then WM_COPYDATA would be a quick and dirty method of exchanging data, otherwise you can use memory mapped files.

Now, I havnt actually tried any of this yet with DB but it should work because I did a similar thing ages ago with a Delphi app and a VB app. I needed the VB window to appear as part of my Delphi app in an MDI interface and the above technique worked a treat. Being as every DB app is built on the standard WndProc structure it should (will) work.
That Guy John
16
Years of Service
User Offline
Joined: 30th Apr 2010
Location: United States
Posted: 2nd Mar 2012 19:25 Edited at: 2nd Mar 2012 20:22
The Weeping Corpse,

Not sure if this is what you were getting at, but..

Yeah I know about setparent, but my thing is how to get the DBpro 3d viewport and the rest of my form to work together.

Like how would I make the DBPro viewport read variable created with the rest of my form.

Say in my form I have something roughly like..

Dim Mesh As String = textbox1.text
Dim DiffuseMap As String = textbox2.text

'User input being the location to mesh and texture

Then have the DBPro viewport be able to use those variables to load the mesh and texture.

Know what I mean?

Adding to:
Maybe having my form write a temp file that the DBPro viewport could read on a loop?

And Here Is A Penguin:
FPSC OneSource [DeskTop App] - Bringing everything together into one.
The Weeping Corpse
14
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 2nd Mar 2012 20:51 Edited at: 2nd Mar 2012 20:52
You need to use inter-process communication (IPC) so that the two apps can exchange arbitrary binary data.

Then you need to build a set of commands on top of the IPC mechanism so that the VB app could instruct your DB app to load a texture or load a model or maybe update a vertex, rotate or move the camera etc.

Quote: "Maybe having my form write a temp file that the DBPro viewport could read on a loop?"


well yep, that is the most basic form of IPC but memory mapped files are the way to go.

this post talks about IPC between two DB apps but the logic is the same for any two apps.

http://forum.thegamecreators.com/?m=forum_view&t=126342&b=1

I'm going to be working away for two weeks, if you are struggling with this when I get back I'll go into more detail for you.
That Guy John
16
Years of Service
User Offline
Joined: 30th Apr 2010
Location: United States
Posted: 2nd Mar 2012 21:34
Okay thanks a lot Corpse,

I know the simplest answer would be for me to use DX but as said.. for some reason I end up banging my head. (still trying though, it can't be as hard as I am making out to be)

Although I think DB would be ideal so I can get a true view of what the mesh, texture, shaders, lighting would look like in FPSC. (please dont run because I said FPSC)

Thank you for the link, bookmarked.

And Here Is A Penguin:
FPSC OneSource [DeskTop App] - Bringing everything together into one.

Login to post a reply

Server time is: 2026-07-09 00:08:51
Your offset time is: 2026-07-09 00:08:51