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 / Can a Dark GDK 3D Screen be embeded in a VC++ Form?

Author
Message
Colonel_Klink
17
Years of Service
User Offline
Joined: 20th Dec 2006
Location: Within the dark recesses of my mind
Posted: 1st Oct 2009 09:47 Edited at: 1st Oct 2009 09:48
I've had a play with PureGDK demo which enables me to embed a DBPro 3D screen onto a PureBasic form. Personally I'd rather either use VB.net or VC++ to do the same job so that i can have Windows-like gui, hence the question above.
Thanks

Oh my gosh! He's wearing Full Metal Pyjamas!
--------------------------------------------
Colonel_Klink
17
Years of Service
User Offline
Joined: 20th Dec 2006
Location: Within the dark recesses of my mind
Posted: 3rd Oct 2009 00:40 Edited at: 3rd Oct 2009 00:55
I'm doing a search through the forums for the second time on this problem and have found a few threads that ask the same question:
http://forum.thegamecreators.com/?m=forum_view&t=113460&b=15
http://forum.thegamecreators.com/?m=forum_view&t=149233&b=22
http://forum.thegamecreators.com/?m=forum_view&t=152551&b=22
http://forum.thegamecreators.com/?m=forum_view&t=143921&b=22
etc. etc.
Someone even suggested that a gui would have to be made using sprites, which seems awfully redundant when VC++ has the means to create proper Windows gui.

However it appears to me that the integration of a VC++ Windows form and DarkGDK isn't possible, which is sad as VC++ has all the controls needed to make nice Windows frontends for DarkBasic.

Anyway for what it is worth this is what I'm attempting to achieve. The green part is the DarkGDK screen.



Perhaps I'm missing the point here and would be better off returning to DBPro and continue with the gui I was creating there.

Oh my gosh! He's wearing Full Metal Pyjamas!
--------------------------------------------
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 3rd Oct 2009 01:00
Well if you are successful with this project, it would benefit many users of the DGDK . I'm sure its possible but the amount of coding it would take would be tremendous id imagine
Colonel_Klink
17
Years of Service
User Offline
Joined: 20th Dec 2006
Location: Within the dark recesses of my mind
Posted: 3rd Oct 2009 01:31
The thing is I have created the interface with the forms designer in VC++. Its now just a matter of integrating it with DarkGDK, and allowing the buttons, menus, etc to interact with the DarkBasic commands. The PureGDK appears to do it, but I'd prefer to go with an industry standard (VC++) than Purebasic. I've looked at buying BlueGui and use it with DBPro, but long term I'd prefer either DarkGDK or DarkGDK.net. The latter being ideal, except for it's apparent lack of integration with some of the plugins. I know this will change in the future, and that's cool.

Oh my gosh! He's wearing Full Metal Pyjamas!
--------------------------------------------
Paynterboi TicTacToe
16
Years of Service
User Offline
Joined: 23rd Dec 2007
Location: That one place
Posted: 3rd Oct 2009 03:41 Edited at: 3rd Oct 2009 03:43
I have seen a thread where Mista was able to incorporate the window into the MDI which i believe is what you are trying to achieve. I'm sure it is 100% possible but you have to understand exactly what the GDK does internally, It is effectively useing the windows API combined with the directx 9.0c SDK to create the windows that we use with the GDK. Because it is already useing the API I can assure you that in some way you can incorporate it, and if you cant just learn directx 9.0c SDK commands and such. In a minute I will get a link to Mista's thread..

[EDIT] This is a quote from my thread "Ultimate Tic Tac Toe" in which i asked a not too disimilar question...

Quote: "It is possible to use Dark GDK and Windows API together. You can't place API elements into the graphic of course, but pop-ups (file open/save dialog, colour chooser, message boxes, dialog boxes) are possible any time. Modeless dialog boxes are also relatively easy. In addition to the API tutorial which I already mentioned, there is another tutorial (credit Sephnroth), which shows how to include a menu into a Dark GDK window and how to exchange the window callback function to make the menu work. You can get it from this thread (links in his original thread seem to be broken but this still works):

http://forum.thegamecreators.com/?m=forum_view&t=137633&b=22

Mista Wilson has even figured out recently how to put a Dark GDK window into an MDI application:

http://forum.thegamecreators.com/?m=forum_view&t=152825&b=22

So the possibility is there but it's certainly time-consuming to get the API elements to work correctly. "


Hope this helps.

EYE R T3H +ick +ack +oe mester
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 3rd Oct 2009 08:56 Edited at: 3rd Oct 2009 09:00
Yes its possible to put GDK into any window that you like, you can even override it into a button if you want to(it would look very strange, but its possible). All windows controls have a HWND handle, and using GDK's dbOverRideHWND() command, you can put the DirectX window into any form that you like.

The trick to using that command however, is to do it BEFORE DarkGDK initializes it's device, you MUST override the HWND before GDK creates it's device. GDK creates it's device upon either the first dbSetDisplayMode() call or the first command to affect anything renderable. You can confirm this by trying to override the HWND after you set the display mode, it just wont work.

The other thing to take into account when using your own windows with GDK is that you need to handle your window's messages or GDK wont read any mouse input, it uses native windows API calls for its mouse input, rather than directinput, so message handling is important. You can use Get/SetWindowLong to work with GDK's own message loop and return CallWindowProc(or its MDI equiv if thats your poison lol) instead of DefWindowProc from your own callback function. Unfortunately GDK doesnt play nice with windows, it hides it's window creation and message pump completely,

I also found a little class library for working with Win32API, its called Win32++ and its meant as a simplification of/simplified replacement for the Microsoft Foundation Classes. It includes the complete source and a HEAP of examples to get you started with it, even a directX example(which translates easily to GDK ) and the best thing is it's compeltely FREE and TINY with almost no overhead at all, certainly no more than any other native win32 app would have, and none of the MFC bloat.

Here is the sourceforge link for Win32++ :

http://sourceforge.net/projects/win32-framework/files/

Here is a link to the CodeProject page for Win32++ (it has more usage examples and class explanations etc, but is a few months behind on updates, so download from sourceforge for latest version) :

http://www.codeproject.com/KB/winsdk/framework.aspx

EDIT : The bloke responsible for the Win32++ Framework is a very talented Austrlalian C++ Programmer by the name of David Nash

If it ain't broke.... DONT FIX IT !!!
Colonel_Klink
17
Years of Service
User Offline
Joined: 20th Dec 2006
Location: Within the dark recesses of my mind
Posted: 4th Oct 2009 00:23
Thank you. I will look into that.

Oh my gosh! He's wearing Full Metal Pyjamas!
--------------------------------------------
Paynterboi TicTacToe
16
Years of Service
User Offline
Joined: 23rd Dec 2007
Location: That one place
Posted: 4th Oct 2009 06:27
You go mista 8-D

EYE R T3H +ick +ack +oe mester

Login to post a reply

Server time is: 2024-10-01 14:42:40
Your offset time is: 2024-10-01 14:42:40