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.

AppGameKit Classic Chat / Is this able to run WinApi code with AGK??? (Example inside)

Author
Message
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 16th Aug 2012 15:38
Hi everyone! Can you please help me?
The AppGameKit doesn't have video playback for now, but I need it very much!!! Just for WINDOWS!
I've found in GDK possibility to start video from WinApi!



To start this function:

But I don't know how to use it in AGK...
PLEASE HEEEEEEEEEEEELP!!!!!!!!!!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 16th Aug 2012 16:48
In Tier 1, I sincerely doubt that this is possible at all. The interpreter only recognizes the Tier 1 Basic commands.

But, since your code appears to be opening a new window, it might actually work in Tier 2.

First, dbWait is not an AppGameKit command. You would need to try agk::Sleep(length*39);

Next, you would need to create a Tier 2 project and include the code in the first snippet. You might get away with including it in the main file, at least for the initial test.

A simple program like:


I don't know that this will work, I'm not sure where g_pGlob is coming from.

Cheers,
Ancient Lady
AGK Community Tester
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 16th Aug 2012 16:50 Edited at: 16th Aug 2012 16:53
SORRY!!! I mean TEAR2 !!!!!!!

It doesn't work... g_pGlob... I don't know how can I change it...
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 16th Aug 2012 16:59
Errors and errors:

error C2872: WAVEFORMATEX: ambiguous symbol
1> could be 'c: \ program files \ microsoft sdks \ windows \ v6.0a \ include \ mmsystem.h (806): tWAVEFORMATEX WAVEFORMATEX'

error C2039: SendMessage: not a member of "` global namespace '"
1> e: \ agk \ projects \ native \ windows \ sprites - anim2 \ main.cpp (18): error C3861: SendMessage: identifier not found
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 16th Aug 2012 17:10
Substitute "g_hWnd" for "g_pGlob->hWnd".

As for the others, show the exact code you are using and post the video you are trying to play. It looks like you are trying to display something not supported.

Cheers,
Ancient Lady
AGK Community Tester
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 16th Aug 2012 17:24
I've just put code what you gave me!
Put into a AppGameKit example 013 - Sprites - Anim 2.

And after Substitute ""g_hWnd" for "g_pGlob->hWnd"" - the same errors!

My video is too big for this site to attach, but it's doesn't metter, because in GDK this function plays any .avi video!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 16th Aug 2012 17:38
I did say I didn't know if it would work. I was just providing a sort of starting point for the code you provided.

You might need to manually add the correct library to link to, assuming it is a Windows library, for the video.

GDK and AppGameKit are very different. GDK is based on using DirectX and AppGameKit does not use it at all. AppGameKit uses OpenGL.

What version of Visual C++ are you using? The error statements look like you are using MS SDK 6.0a. You might need to update to the most recent versions. But that might not be the problem at all.

The errors you list in your second error post are not related to g_hWnd. I suspect they are related to something in Vfw32.lib and Vfw.h. It is not impossible that their is something in the core AppGameKit headers that conflicts with something in the Vfw library.

I can't help you with any of that, sorry.

I was only offering a starting point to test from. I have not tried to do anything Windows specific with AGK.

Cheers,
Ancient Lady
AGK Community Tester
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 16th Aug 2012 18:40
It's bad...
Anyway thank you for trying to help!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 16th Aug 2012 19:00
Good luck.

Happy Programming!

Cheers,
Ancient Lady
AGK Community Tester
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 17th Aug 2012 00:00
The problem is that GDK is using a DX surface, so you might be able to play using MCI (though you would be better off using DShow).

AGK uses an OpenGL surface - so it's possibly impossible or definitely not easy to render into that outside a GL context.

You could in T2 or T3 create a playback window, but you'd have to make sure it was topmost - and AppGameKit will have tight control over the Windows message loop. So you'd be better off making a separate video player and running it with CreateProcess(). Obviously, that's not going to be cross-platform.

Don't assume that any AVI will play. For example, a DIVX-encoded avi will only play if DIVX is installed. AVI is (like mp4) a container, and the required codec may not be present!

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL

Login to post a reply

Server time is: 2024-05-06 00:10:53
Your offset time is: 2024-05-06 00:10:53