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 / Does Window Form code intergrate into game code

Author
Message
Give it all you got
17
Years of Service
User Offline
Joined: 17th Nov 2006
Location: USA
Posted: 20th Apr 2007 04:06 Edited at: 20th Apr 2007 05:08
I want a form to pop up when I go to an object in my game. This is with DARK GDK.NET.
Is this possible APEXnow?

G4G
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 20th Apr 2007 09:54
Yes, of course. It basically involves you creating your form as normal, but when you want the form to appear, you'd do something like this:


This is pseudo code of course, but you can instanciate your form at anytime, whether it'd be based on an object collision event, or whether you click on an object based on MouseX and MouseY etc. It's pretty much up to you on how you code the logic.

Paul.


Abundance = Choice = Freedom - Scarcity = Dependancy = Control, Truth!
Give it all you got
17
Years of Service
User Offline
Joined: 17th Nov 2006
Location: USA
Posted: 20th Apr 2007 12:06 Edited at: 20th Apr 2007 12:33
Is there any documentation out there that would give me some code examples on how to do things I am talking about or "BOOKS ON THIS SUBJECT, like WinForms Programming in C#" I mean documentation on creating window forms and adding controls and making them work with the game code.

Another thing, Can I create a windows form by going to "Project", "Add Windows Form", Then picking "Windows Form", Then "Add Controls and other stuff".
And then intergrate this in my game code so it would work with my game. Could you like give me a code example on how to that.

Thanks,

Chris

G4G
James Bondo
17
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 20th Apr 2007 14:21
I just threw together a quick example, see attachment.

However theres one problem, the form pops up behind the game window, but that can be fixed by just showing the form normally (instead of using ShowDialog() as i did) and then calling the Focus() method on the form.

The example is written in C#

Using Dark GDK.NET

Attachments

Login to view attachments
Give it all you got
17
Years of Service
User Offline
Joined: 17th Nov 2006
Location: USA
Posted: 20th Apr 2007 18:52
When I try to compile it, it says that FormExample.exe is missing.
Did you miss something with the folder. I'll try to figure it out.
If I don't I'll try to get your help again.

But looking at the code, it is a great example of how to intergrate C# WinForms with Darkbasic. Thanks for your help. I wish I had the skills like you do. By studying the References list, that will help me a little right. When I looked at the references list, It seemed like I grasped something new about programming. I know by looking at the DarkGDK LIB Reference, it showed me all of the commands that is available to darkbasic. So I learned that.

G4G
Give it all you got
17
Years of Service
User Offline
Joined: 17th Nov 2006
Location: USA
Posted: 21st Apr 2007 05:35 Edited at: 21st Apr 2007 05:40
Never mind

G4G
Give it all you got
17
Years of Service
User Offline
Joined: 17th Nov 2006
Location: USA
Posted: 21st Apr 2007 18:01
James Bondo,

Your code examples have bugs in it. I get an error message saying it can't find "FORMEXAMPLE.EXE". Where is "Interop.DGDK.1.1" at. I even installed the updates and it didn't have it. I looked in the "\The Game Creators\DarkGDK.NET\Redist\Plugins" Directory and I found "Interop.DGDKLib.1.0.dll" file, but that isn't the right file. I added it as a reference, but it didn't work. I know I am missing "Interop.DGDK.1.1", where do you get that file at.

Thanks...

G4G
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 21st Apr 2007 18:35 Edited at: 21st Apr 2007 18:36
Give it all you got, you need to update your toolkit to v1.0.9.0

Download it from your Orders page. Uninstall your current DGDK.NET version first before installing the new version. Also, can you download the patch file as well and install that (AFTER) install v1.0.9.0.

Paul.


Abundance = Choice = Freedom - Scarcity = Dependancy = Control, Truth!
James Bondo
17
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 22nd Apr 2007 15:56
It runs as it is here.

In case you cant get it to work, i attached the compiled files to this post.

Using Dark GDK.NET

Attachments

Login to view attachments
Give it all you got
17
Years of Service
User Offline
Joined: 17th Nov 2006
Location: USA
Posted: 1st May 2007 19:51
I'm still getting an error message..........

I have left you a picture of the message to see.
I put the program in a working folder.

G4G

Attachments

Login to view attachments
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 1st May 2007 20:16
GIAYG, would you mind emailing me the whole project file because I want to see if this is caused by a specific key type.

If this is related to a similiar issue I had with the Authenticator, I can fix it relatively quickly, but I need to see the project just to be sure.

Paul.


Abundance = Choice = Freedom - Scarcity = Dependancy = Control, Truth!
Give it all you got
17
Years of Service
User Offline
Joined: 17th Nov 2006
Location: USA
Posted: 1st May 2007 20:50 Edited at: 1st May 2007 20:50
Here is the compiled program I got from James Bondo.

G4G

Attachments

Login to view attachments
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 1st May 2007 21:22
Well, I can only put it down to either a DirectX issue, or a problem with your video drivers. It runs without issue here.

If you're trying to run under Windows Vista, can you try to see if these updated DX drivers help?...

http://www.microsoft.com/downloads/details.aspx?FamilyId=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3&displaylang=en

Paul.


Abundance = Choice = Freedom - Scarcity = Dependancy = Control, Truth!
Give it all you got
17
Years of Service
User Offline
Joined: 17th Nov 2006
Location: USA
Posted: 1st May 2007 22:55 Edited at: 1st May 2007 22:56
Thanks, it might be a video card driver issue. I know that I got all of the stuff for DirectX. It must be a video card issue. You can't like make a fix to this problem. Like make the DBGDK kit get around this issue like the "SHADOWING or SHADERS" issue you helped me with a while back.

G4G
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 1st May 2007 23:21
GIAYG, I'm not entirely sure what's causing the error though because the sample you sent me practically does nothing that's GPU specific. Does the Authenticator work ok when authenticating the very same project?

At the moment, I can't tell whether it's a key issue, or a GPU issue.

Paul.


Abundance = Choice = Freedom - Scarcity = Dependancy = Control, Truth!
Give it all you got
17
Years of Service
User Offline
Joined: 17th Nov 2006
Location: USA
Posted: 2nd May 2007 01:01
When you mentioned
Quote: "" Does the Authenticator work ok when authenticating the very same project? ""
Do I have to use the Authenticator to make the FormExample.exe file to work that I have in the "DBform" Directory. I have just tried it and I get this type of file generated "FormExample.dgdk". Then I execute the FormExample.exe and I get the same error message showing in the file attachment. There got to be some kind of fix. I will keep working with you on this issue. I really need this Development Kit to make my game, so I really want to figure this out. I know this Kit isn't fully developed yet, but I hope I can help.

G4G

Attachments

Login to view attachments
kBessa
17
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 2nd May 2007 01:06
Have you Embedded it as a resource? Only putting it on the directory won't work.

@Paul, about the authenticator, have you got my email? I hope you can help, I can't wait to release DE 0.2.

Cheers,
Thiago
James Bondo
17
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 2nd May 2007 01:25
The exefile works out of the box here, so it has nothing to do with embedded ressources or whatnot.

However i've seen this error before while developing with DGDK.Net. It happened because i did not have full administrative rights to the location where the exe file was run from.

If you are administrator of your computer, try putting the exe file and the dll files in c:\test\ and run it again.

In my case it was run from a networkshare (home folder) on my school. I have full read/write rights to my folder, but not to the actual share, and therefore the project failed to run. Copying the files to C:\ worked.
The error is not specific to DGDK but to .NET, i also got the error when using dll calls (windows API).

Using Dark GDK.NET
Give it all you got
17
Years of Service
User Offline
Joined: 17th Nov 2006
Location: USA
Posted: 2nd May 2007 17:54
Why can't yall allow this program to work on any computer without any bugs. If I made a game using this kit, some peoples computer would play the game and some computers wouldn't play it at all. I notice that when you buy a game to play from a store it works fine. Why can't it be like that? I really want to use this GDKIT.

G4G
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 2nd May 2007 21:32
Thiago, sorry for my delay in response to your email, I've downloaded them samples and I'll try to figure out what's going on. I think I may know what's going on anyway, but I need to prove it and provide a workaround.
___________________

Give it all you got, Can you tell me, do ANY of the samples that come with DGDK.NET, run? I need to determine if this is a GPU problem, or it's specific to Authentication. This was one of the reasons why a patch was released for the Authenticator. If none of the samples run, then I think that the problem is to do with the DGDK.DLL component and I will need to release an update.

It's a long winded story, but it comes down to a library update which broke things for the Authenticator. It may be that this same problem is happening with the component and it's specific to a Windows configuration.

All I need to know is, do any of the samples work, and does any application (YOU) have written, authenticate and run?

Thanks.

Paul.


Abundance = Choice = Freedom - Scarcity = Dependancy = Control, Truth!
Give it all you got
17
Years of Service
User Offline
Joined: 17th Nov 2006
Location: USA
Posted: 3rd May 2007 01:45
I guess I'm getting frustrated with this stuff, just please excuse me.

Your question was, do any of the samples that came with the darkgdk.net kit work. Yes they do, except for the WinForms Example.
You have to turn off shadder support to get it to work. When It comes to intergrating the form with the game code it just don't compile right. It just don't work right. I know it is hard for you to tell what is going on in my computer, but I will try everything you ask me to. Right at the moment I am using another game engine to make my game, hope I didn't hurt you any way. I know there is still improvements you can make in your GDK.NET kit. I think it should work with all of the available graphic cards out there, than besides the New Graphic Cards, that is what I am guessing.

Hope that works...

G4G
James Bondo
17
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 3rd May 2007 02:20
I can run DGDK.Net games on my old K6-2 with an onboard ati something grahics card from late 90s AKA +-10 year old computer.

Shaders is not mandatory for a game. In a production game, you ofcourse make checks in the code if the computer you attempt to run the code on actually supports various features before actually activating them. The WinForms code that comes with DGDK.net toolkit is just a crude example of a winform code. And because it is just that, there was no need to test for compatibility of that shader before activating it.

The error you posted a screenshot of has nothing to do with DGDK but rather the .NET framework.
Did you ever try putting the files elsewhere than on your desktop?

Using Dark GDK.NET
Give it all you got
17
Years of Service
User Offline
Joined: 17th Nov 2006
Location: USA
Posted: 3rd May 2007 04:28
James Bondo,

I just tried what you said. It did not work. Maybe I am just the only one that has this problem. Maybe this is a rare case for me. I really don't know.

G4G
Give it all you got
17
Years of Service
User Offline
Joined: 17th Nov 2006
Location: USA
Posted: 28th May 2007 23:28
I am back.

I just tried the form example james bondo put on here a long time ago and it works on my pc now! I must of did something different

G4G

Login to post a reply

Server time is: 2024-09-29 01:21:28
Your offset time is: 2024-09-29 01:21:28