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 / Child Windows and Threading

Author
Message
catjes
16
Years of Service
User Offline
Joined: 3rd Oct 2008
Location:
Posted: 3rd Oct 2008 20:07
Hey all,
i want to create child windows - are there any issues with this? (Im aware of performance, and thats not an issue for the game), I was going to use CreateWindow/Ex() - but need to get handles to some of the parent window stuff - does darkgdk support multiple windows in one app

Also - i am assuming message queues and threading is not an issue (ie I can pretty much use the full C++ apis from MS) when writing an app

Anyone else done this or got any tips?
thsnks from a newbie
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 3rd Oct 2008 22:21
I've looked into this on a minimal level, but haven't come up with a whole lot, to be honest. I would use the forum search at the bottom left of the page to try and find what has already been discovered.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
catjes
16
Years of Service
User Offline
Joined: 3rd Oct 2008
Location:
Posted: 3rd Oct 2008 22:35
Ok, Ive looked in the forums and there is a bit there on DarkBasic stuff. Need to look more closely. I have been playing around and created a windows class and createwindow call, builds ok, just wont link

1>animation.lib(dllentry.obj) : error LNK2019: unresolved external symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A) referenced in function _DllGetClassObject@12
1>animation.lib(dllentry.obj) : error LNK2019: unresolved external symbol "int g_cTemplates" (?g_cTemplates@@3HA) referenced in function _DllGetClassObject@12
1>Debug\EcoModeler.exe : fatal error LNK1120: 2 unresolved externals

Will try and see what Ive broken, believe it is animation.lib from GDK, not sure why except that using windows.h has broken soemthing
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 3rd Oct 2008 22:41 Edited at: 3rd Oct 2008 22:42
I've worked with multi-threading and the GDK before, and it's not efficient for a couple of reasons, but primarily because two GDK draw operations can't be called at the same time, or it will crash. If you have a thread that attempts to draw anything, it will almost certainly crash your program. As for the handle to the GDK window, it's easy enough to get. My preferred method is by including globstruct.h. You can then use g_pGlob->hWnd as your window's handle.


I assume you're somewhat familiar with WinAPI if you're going to use CreateWindowEX...


My site, for various stuff that I make.
catjes
16
Years of Service
User Offline
Joined: 3rd Oct 2008
Location:
Posted: 4th Oct 2008 06:08
well i spent a day experimenting, and can register a class for a window.
i fixed the link error by overloading the missing class and creating the variable (lots of google searching) - its not new comes from dll callback entry points included with dx stuff in globstruct.h.

i cant create the window, thing fails with a return of a null pointer and 0 as the error number, very frustrating.

I notice in the globstruct though (while debugging) that the hwnd is not populated and hinstance is....anyone else know anything about this?

I have searched the forums and lots of basic (the language) stuff, v. little c++

sigh - now i just have to make it work cause it should .... how useful it will be

Login to post a reply

Server time is: 2024-11-25 03:34:09
Your offset time is: 2024-11-25 03:34:09