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.

Dark GDK .NET / Reference to DirectX?

Author
Message
MoomanFL
17
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 7th Feb 2009 08:10
Is there a way to get a reference to Direct3D through DGDK.NET? If so, where do I look and what is the best method to utilize it?

Design documents?!? What design documents??? I thought we were just going to wing it!!!
Cloggy
18
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 7th Feb 2009 09:32
The command you need is



MoomanFL
17
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 7th Feb 2009 10:20 Edited at: 7th Feb 2009 14:28
Thanks Cloggy. After posting, but before checking here I found it.

For future reference for anyone wanting to know the same thing you need to add a reference to the Microsoft.DirectX.Direct3D assembly and the DGDKPlugins assembly mentioned above in Cloggy's post..

The following 2 lines of code will get your reference to the Direct3D device:



Of course you can use Import Microsoft.DirectX.Direct3D at the top of your code to shorten this a bit.

@Cloggy:

As a side note, the point of wanting to do this was to see if I could replicate your plugin functionality as I am currently in need of quicker drawing of fonts and boxes etc. I read in another post that you were looking into converting your plugin for DGDK.NET. Is that still in the works?

Also I have seen mention that you have completed the conversion for DGDK but I haven't seen a download for it. Any chance you could put it up on your site with the downloads for the DBP plugin?

EDIT: Nevermind on that. You have posted it on your site since the last time I checked. Heh heh.

Lastly, thanks for that awesome plugin... I have already gotten tons of use out of it in DBP. The unfortunate side effect is that it has spoiled me and I can't do without it now.

EDIT: One last thing... would it be possible to add an overload to the D3D_INIT function in the DBP plugin to allow a person to optionally pass a D3D Device reference for it to use rather than having it get DBP's reference automatically? I wanted to use your plugin in another plugin I was making but kept getting access denied errors which I suspect were due to it trying to get a reference to the D3D Device third hand.

Design documents?!? What design documents??? I thought we were just going to wing it!!!
Cloggy
18
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 8th Feb 2009 21:37
MoomanFL,

Personally I've used SlimDX in my .Net (yet to be finished) plugin conversion. As soon as ApexNow adds the extra functionality I need I will complete the .net version. BTW has anyone heard from ApexNow lately as I haven't seen any posts from him for ages?

The DGDK library is on my website now.

Exactly how are you attempting to access my plugin from your plugin.

It may be better for me to add a SetD3DDevice method to the dll which is only callable from other plugins.

MoomanFL
17
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 9th Feb 2009 04:26
Since posting my questions to you I have been going through your original C++ code for the DBP plugin and have converted the code for the D3D_Box command and the D3D_Color command into a small class that can be added directly to my projects without need for a Class Library assembly. I didn't use SlimDX, but since it is just a Class.vb file it should compile with whatever version of DirectX the programmer is using.

Since I still use DBP some though I would really like to get a version of the D3D_Init function in the original plugin that accepts a Direct3D reference. I am still relatively new to C++ and have only used DevC++ for the plugins I have made. I haven't been able to get your source to compile, even without changes, for the DBP plugin or I would have added it myself.

Design documents?!? What design documents??? I thought we were just going to wing it!!!
Cloggy
18
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 10th Feb 2009 20:54
Do you have a real aversion to MSVC++ 2008 Express as I'm sure it should compile in that?

I'm still not 100% sure how you a calling this plugin from your plugin. Could you post some example code and I may be able to help.

MoomanFL
17
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 11th Feb 2009 02:39
Quote: "Do you have a real aversion to MSVC++ 2008 Express as I'm sure it should compile in that?"


Considering that my main computer bit the dust and I have limited space on my laptop... installing yet another development platform would be a big problem. Any reason why it wouldn't have compiled "out of the box" using MSVC++ 2008 Pro under Vista (32 bit)?

While I used Dev-C++ for making my plugin I used MSVC++ 2008 Pro for compiling yours.

As for the plugin I was working on... the code is below:

In a file called CloggyCommands.h


in main.cpp


my string table entry for the one command


It compiles with no errors. The DBP use of it follows:


As you can see, I include a command from your plugin to make sure it is included. The program compiles without an error, but when run the window comes up and gives an Access Violation.

I am not ruling out the possibility that I have done something wrong in the way I call your DLL. Keep in mind this was compiled with Dev-C++.

Design documents?!? What design documents??? I thought we were just going to wing it!!!
APEXnow
Retired Moderator
20
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 11th Feb 2009 13:42
Cloggy, apologies for my lack of posts. I've been building a new PC recently and has kept me busy. Also, there are things in the pipeline related to the toolkit that are urgently needed to be finished. If I'm not here posting, I'm busy working lol.

I'll jump in as much as possible whenever I can.

Paul.

Cloggy
18
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 11th Feb 2009 13:51
To be honest I'm not a big c++ expert, but I don't think you could access my dll in this way as it is dependent on the core DBPro dll's. You could use my GDK library, but I dont think you can use the GDK to produce plugins.

Maybe you just need to pull out the code from the dll that you require.

APEXnow
Retired Moderator
20
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 14th Feb 2009 05:28
Cloggy, if I understand your plugin design correctly, you basically need access to the internal data structures provided by both DarkBASIC Professional or DarkDGK (C++) right? Both of these requirements is possible via a CLR based DarkGDK.NET plugin. But if you are using a set of undocumented DLL Exports, i.e. the ones that were exposed in the DBPro DLLs, I can make these available in DarkGDK.NET. It does become a big issue when dealing with unmanaged structures such as the (sObject) structure in .NET.

Plugins written for DarkGDK.NET really need to be written in /CLR based C++ DLL projects because this allows for mixed pointer/structure access that both VB.NET and C#.NET restrict.

Paul.

Cloggy
18
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 14th Feb 2009 14:24
ApexNow,

You're right I'm using structure provided by DGDK. smesh & scamera are the particular ones I use.

MoomanFL
17
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 16th Feb 2009 01:08 Edited at: 16th Feb 2009 14:16
In the meantime I have these functions that I ported over from D3DFunc and put in a Class.vb to be included in a project. They include the Box, Line, Dot, and RoundedRectangle functions. Incidentally, I had to use a bit of a workaround for RoundRectFilled function because I couldn't figure out how to get it not to draw that first line in the outline... so I had it make two Vector4 arrays: One for the TriangleFan and one for the LineList. The nice part about this is that I was able to include one more overload that lets you set separate colors for the outline and the fill on the RoundedRect.

Of course you will have to included a reference in your project to DirectX and Direct3D. Full credit to Cloggy for the original functions in C++. Most of my work was just translation:



Design documents?!? What design documents??? I thought we were just going to wing it!!!

Login to post a reply

Server time is: 2023-05-29 17:39:13
Your offset time is: 2023-05-29 17:39:13