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 / Flash in GDK, here is a way.

Author
Message
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 21st Aug 2007 01:01 Edited at: 21st Aug 2007 01:29
I know some of you are looking for GUI's and some want flash . Despite of the memory issues here is a trick. I can't take all credit this was done via information on the web namely Stephane Bourez and Ladislav Nevery..

In you'r includes

#include <windows.h>
#include <exdisp.h>
#include <mshtmlc.h>

// you will need to use mshtmlc so you need 6.0 or PlatformSDK..

also




then where ever in your main.. you could do


to call an swf. or better yet...



so you can gets vars from flash. Just make sure it put you code in the while (getMessafe... or a link to it. Game->runMain or what ever.

If you want to pass it back you can use this idea..

http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_16184

and just use method SetVariable on flash object.


Lastly transparency..

I have not tried this part but here is the idea..



Bigest trouble I have right now is how slow it runs..

If any one has a chance to try this let me know. Maybe its my system that runs so slow. Or if anyone has better understanding of windows calls jump right in..
psx
17
Years of Service
User Offline
Joined: 16th Apr 2007
Location:
Posted: 22nd Aug 2007 00:53
Wow man. This is a deep Win32API programming.
If I knew this, I would code on DiretX instead of GDK
Jna99
18
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 22nd Aug 2007 12:31
psx don't forget that DirectX is a library not an engine..

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 22nd Aug 2007 14:32
Ya, Dx is not much of a game engine. And windows API is nothing like DX. Think of GDK is a wrapper around DX.
Daggeth
17
Years of Service
User Offline
Joined: 3rd May 2007
Location:
Posted: 22nd Aug 2007 23:21
Direct X/OpenGL are wrappers around the assembly/c code you'd have to feed into your device(video card) manually, much like ASM shaders.

DarkGDK is a wrapper around archaic and confusing DirectX calls.



Back on topic: Why not just use winforms? I know they aren't pretty, but they're the fastest prototyping UI you can put up on a project that'll do you justice way towards the end when you're ready to hammer out a DX UI.
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 23rd Aug 2007 01:32 Edited at: 10th Sep 2007 14:58
Certainly a been talked about, and it is an idea for a gui. But Flash has some advantages..

one) Just about ever one.. and there dad, brother, dog, cat rat what ever can use it.

two) can be "pretty" Flash has a lot of control, not that all of that control wold be supported.

three) would be a quick and dirty solution.

Dont get me wrong my point is not to find a GUI for GDK it was to get flash working with it.

I was able to fix the speed issue and got vars back and forth but the transparency and "always on top" with with out steeling focus was another thing.

Was a great Idea in some ways but I think ill let it die.
Jna99
18
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 9th Sep 2007 13:40
Guys can you give me an concrete example of flash working on GDK?

Jna99
18
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 10th Sep 2007 13:08
Anyone? About the UI issue, I'm thinking of making my UI on Flash 'cause I get more visual stunning, problem is if I want to dynamic have components on my flash ui... I don't think it's possible! something like this

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 10th Sep 2007 14:57 Edited at: 10th Sep 2007 14:59
Hey Jna99 as stated above it works just a few issues..

one, I could not perfect the transparency. I dont feel it is impossible, just out of my windows programming ability.

two, the issue of control. What windows gets control and when. One way around this would be to write a pass though function in flash to send the keys over.

three, this would not work for any joystick operations. Flash knows nothing of joystick as far as i know..

A better method then above would be to write an SWF player for GDK. But I don't have any info on a SWF SDK or if there even is one. I do know that other engines have made one. For example Power render has one. No Action Scrip but plays SWF's..
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 11th Sep 2007 01:24
Your focus issue reminds me of how with web pages you control WHICH is on top. This makes programs with "caliber", like Microsoft Dynamics CRM, unable to set the "on top" page with any certainty. I wonder if its a similiar thing.

Flash doesn't seem the "right" way to go in my opinion for a UI at all.. but I am not knowledgable enough to know why it may be advantageous. I do know that with the windows framework you can theorectically do everything that you can do in flash - I mean that's what MacroMedia(adobe now? ugh) did. There are a lot of libraries out there for 2d manipulation if that's what you want. Also there is a lot that can be done with standard windows controls just by getting fancy like chaning button shapes etc.

I also know that Flash has tons of "calls" that simplify things - and that alone makes it worth it!

Good Job getting through the Windows API - it's always a pain - but once you nail something - it tends to work for a long time - until Microsoft drops the calls or whatever.

I just hope they keep making C++ the real backbone and do not go .net everything because .net simply is not as fast - even when I try to "give it a go" - C# is great for business apps - but not so great for making games in my opinion. It is easier though - I give it that boy - its like they say C# is a cross between VB6 and C++ - you can do really neat things - and its easy. C++ is a bit harder.

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 11th Sep 2007 16:19 Edited at: 11th Sep 2007 16:21
jason p sage, your right its silly sense to use flash. Then let us ask our selves why a huge company like EA does it. Well that actually is a simple answer. How much does it cost to hire a C++ UI designer vrs a Flash UI designer....


In some cases it's just smarter. My rule of thumbs is and always will be. - There is a reason for everything. Ya it may not make sense to me, but does so someone else with different needs. Thus it's always better to have more option then fewer and better ones.
Jna99
18
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 11th Sep 2007 18:04
...Problem with MFC it's that I can't get transparency to work, and of course since I'm using GDK I've got to do the OverwriteHWD which means that my GDK input are got through a "frozen" GDK window that cannot be close...

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 11th Sep 2007 19:12
Ya that was my troubles also..
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 11th Sep 2007 19:41
@Unitech -
Quote: "In some cases it's just smarter. My rule of thumbs is and always will be. - There is a reason for everything. Ya it may not make sense to me, but does so someone else with different needs. Thus it's always better to have more option then fewer and better ones. "


I'll buy that

Jna99 and Unitech - Are you using .Net? I ask because I don't know how you're accessing the MFC - the C++ MFC or a .Net one. I ask because I'm thought I saw (for C#) a way to simply toggle transparency on forms - and I'd suspect that there may be a way to utilize this seeing how its been shown that its fairly easy to put a direct-x "window" or "camera view" on a standard windows form.

Is that something that would help ya?

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 11th Sep 2007 20:10
c++, here, VS2005. I would not touch c# thx.
Jna99
18
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 11th Sep 2007 20:10 Edited at: 11th Sep 2007 20:11
I'm using the C++ MFC..this issue is giving me many headaches

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 12th Sep 2007 01:31
How about bitmapping to an image and displaying on a transparent plain? does that work? I think its already been recommended - but this is one headache advil can't help - we want you and your project to go well!

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 17th Sep 2007 14:48
bitmapping to an image works great for in game tricks, but would not work with flash since the flash has to be on another application window out side GDK's window. Not sure if this is what you meant.
Jna99
18
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 17th Sep 2007 18:03
OK so from what you can all tell me flash has no use in GDK?

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 17th Sep 2007 18:26
In the simplest form .. YES.

If you really wanted to use Flash in GDK you would need to start at the source. That is the DGK team would need to add this in the main source. My attempt was to use an over lay, and pass it in from GDK to Flash, but its not a picnic.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Sep 2007 18:39
Flash might be a good menu system front end - that "shells out" to the game or whatever.... but in game - just considering clock cycles alone I wouldn't want it slowing my games down. (You don't have much time between frames to try a bunch of application back-n-forth comm -- especially seeing how they would likely be different threads)

James Bondo
17
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 17th Sep 2007 18:42
The recently released game Bioschock uses flash for menus. It causes horrible slow downs for ingame menus, with 3D running in the background and semi transparent flash in the foreground.

Using Dark GDK.NET
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 17th Sep 2007 18:46
An engine I used POWER RENDER Did this, they put an SWF loader so it could be added to a texture, and it was rather impressive. At any rate any menu system would be a waste of time if it could not directly work with the game engine. Also running flash out side or inside the game engine would still slow the computer down. Flash is just not a well designed TRUE language. More like a warper on top of a wrapper on top of an application. Heck it does actually compile when its published. It is just some what encoded.
Jna99
18
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 17th Sep 2007 19:46 Edited at: 17th Sep 2007 19:48
So from what I get, big companies like EA, Ubi etc... only use sprites or object to make UI's? if so that seams quite limited...but if you all think of those animated ingame menu's the work behind it it's huge!

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Sep 2007 20:27
Jna99 - I REALLY think almost all the Really Cool menu systems are home grown - in game.

1: Unique Look and Feel
2: Utilize Game Engine - Code-to-Hardware conduit - already established (runs faster and works already)
3: side-Effect - Harder to make "mouse clicking robots" if windows API and dirivitives of are used. (Windows Message Handler is really the devils playpen)
4: Every list looks more impressive with at least four items ..hence this one

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 17th Sep 2007 22:21 Edited at: 17th Sep 2007 22:22
Jason , you could not be more right. It simply is the best way to go. But even better, make you own gui using the flash engine and now you can hire for cheep. Its a company decision. If it were me id go the home brew way. And save on cpu cycles.

Login to post a reply

Server time is: 2024-10-08 22:15:18
Your offset time is: 2024-10-08 22:15:18