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 / Playing a video

Author
Message
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 30th Sep 2009 20:36
Hello everyone,

i have searched in this board about animations, and got really confused, in the docs i found dbLoadAnimation() and dbPlayAnimation(), usedt hem in my program, no errors, but no results either, when i searched in this board i found some programs to play video's, well 3, 1 of them doesnt exist ( wrong link ), one of them is a wrong code, and the last one was too long, so how can i play videos in my game?

thanks.

jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 30th Sep 2009 21:50
I believe the animation command were removed. Search for DarkVideo

Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 30th Sep 2009 21:57
i saw the post, and cant follow the download link, it leads me to a page without any download button

sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 1st Oct 2009 05:27 Edited at: 1st Oct 2009 05:32
I dont have DarkGDK installed anymore but here is the code that I use for my DirecX menu front end.
You should be able to adapt it to DarkGDK.



You can call it like

hgWnd is the handle to the DarkGDK main window.

Hope that helps.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 1st Oct 2009 11:31
Cool, thanks dude but im getting one error:




chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 1st Oct 2009 15:37 Edited at: 1st Oct 2009 15:39
the animation commands work fine in gdk , what i do is load the animation , make a plain and use dbplayanimationtotexture() then texture the plain , also you need to have the correct codecs installed for the particular video you are using.

If you are making a serious game you should buy the dark video , no codecs needed for that , and its mighty fast with its own file format .

Also if you use the code above you need to link winmm.lib / vfw.lib to make it compile.

chunks

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 1st Oct 2009 16:36 Edited at: 1st Oct 2009 16:48
Hmm, ill check dark video, thanks.

edit: how to include a library? is it by

? if so, this is giving me the following error:


sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 1st Oct 2009 17:32
Thanks chunks chunks , I forgot to mention that 2 libraries that have to be linked into the EXE. "winmm.lib" and "vfw.lib"

Some one should make a proper tutorial for this.
For many people it is enough to just be able to play any of the standard windows formats.
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 1st Oct 2009 17:37
TRY vfw32.lib instead of vfw.lib
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 1st Oct 2009 17:56
works perfectly, thanks dude thats awesome! never excepted it working with really little code like that

So to finish the video, all i have to do is Sleep(video_length) or dbWait() then DestroyWindow()? or there is a better way?

also: what file formats are supported using this function?

sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 1st Oct 2009 18:08
Normally one plays the video when one is in the menu screen. This means that in general one is not in the game loop at this point, so what should happen is the video will start up and play. When it is finished the video window should shut down automatically, and the code will continue from that point. How you choose to integrate it into DarkGDK code is up to you as I have not used it in that context.

As I mentioned before, I used it from within the windows API code (never tried it from within DarkGDK itself) and used the window callback function to look for an Escape key and shut the video down early if the player wanted to do that.

That code should work for any media format that windows will natively support.

Should you clean up the code for use in DarkGDK, please post it in the code fragments area for others to also get the benefit.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 2nd Oct 2009 15:12 Edited at: 2nd Oct 2009 18:41
oops forgot about the 32 lol , i have been using it to a couple of weeks ago too, my memorys not what it used to be lol , nice code snip there i might store that one for future use.

To be honest i think the dgdk animation commands are all he needs for this , they can tell you whether its playing or not ,not sure if it tells you when the vid ends , anyways i will have a look tonight , see if i can get them working they used to work fine but i haven`t checked as of gdk 7.4.

:EDIT
jezza was right the animation commands are in the headers but don`t seem to work anymore ,i have all the releavent codecs installed perhaps it should be posted in the bug reports .

Maybe if sybods way isn`t what you want you can look in the directx sdk to see if there is a way to play vids .

chunks

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
sonraditz
15
Years of Service
User Offline
Joined: 12th Sep 2009
Location:
Posted: 23rd Oct 2009 09:25
Hey i am trying to put a video on my game too i typed in all the code and it all seems to be fine until i call it. it comes up with a error error C2065: 'hgWnd' : undeclared identifier. i see that sydbod says hgWnd is the handle to the DarkGDK main window. and the code doesent clarify what hgWnd is. How do i fix by clarifying hgWnd? Please help me

thank you - Son Raditz

Login to post a reply

Server time is: 2024-10-01 14:33:11
Your offset time is: 2024-10-01 14:33:11