ok yes i am a n00b at C++, i am wondering how i would have a full screen movie to play in a exe file. Could anyone tell me please?
ok yes i am a n00b at C++, i am wondering how i would have a full screen movie to play in a exe file. Could anyone tell me please?
What? By fullscreen movie I am assuming you mean just run an exe in a fullscreen mode.
http://cboard.cprogramming.com/showt...ght=fullscreen
Woop?
like i wanna creat a .exe file that is in fullscreen and plays a movie. IM creating a game and im using this for a cinimatic. The files are a .wmv
Good luck with that. No offense that is a pretty difficult task
Woop?
Since wmv files are Windows Media Videos, you will most likely have to use MFC or Win32, I personally hate MFC and really like Win32. Anyways, I found this tutorial here. Unfortunately the tutorial uses MFC, but oh well. If you are a noob to C++ then I think you are not nearly ready to do this. You should get comfortable with C++ and maybe move into Win32 or, heaven forbid, MFC. Then try to take this on.
Trinity: "Neo... nobody has ever done this before."
Neo: "That's why it's going to work."
c9915ec6c1f3b876ddf38514adbb94f0
Take these guys advice, its a ........... Fortunately, DirectX comes with a nice wrapper class to handle playing videos for you, but a strong knowledge of Win32 is required. Check out DirectShow when you're ready.
-"What we wish, we readily believe, and what we ourselves think, we imagine others think also."PHP Code:
sadf
I believe the recommended API for playing a movie is DirectShow. However, we can cheat by using the simpler MCI API. Here is a simple example that plays a video in a maximized window.
Code:#include <windows.h> #include <stdio.h> #if defined(_MSC_VER) # pragma comment(lib, "Winmm.lib") #endif /* * Plays an WMV, AVI or MPEG video file. */ BOOL xPlayVideo(LPCTSTR szFile) { TCHAR szCommandString[500]; wsprintf(szCommandString, TEXT("open \"%.260s\" type mpegvideo alias MediaFile"), szFile); /* By default mci functions will return immediately and the task will be carried out * asynchronously. To have the function wait, place the word "wait" at the end of the * command string. ie. "play MediaFile wait" */ if (ERROR_SUCCESS == mciSendString(szCommandString, NULL, 0, NULL) && ERROR_SUCCESS == mciSendString(TEXT("window MediaFile text \"Game Intro\""), NULL, 0, NULL) && ERROR_SUCCESS == mciSendString(TEXT("window MediaFile state show maximized"), NULL, 0, NULL) && ERROR_SUCCESS == mciSendString(TEXT("play MediaFile"), NULL, 0, NULL)) { return TRUE; } return FALSE; } int main(void) { MSG msg; if (!xPlayVideo(TEXT("C:\\PathTo\\YourVideo.wmv"))) printf("Failed to play video!"); /* We must run a message loop while the video window is open. */ while (GetMessage(&msg, 0, 0, 0) > 0) { TranslateMessage(&msg); DispatchMessage(&msg); } return 0; }
what are you using as a complier? im using Dev-C++ and im getting errors on this code so
May I ask how deep your knowledge of C++ goes? Something a little more detailed than "I'm a n00b", because if you're creating a console game and have no knowledge of windows or game programming, then I'd say you're years off from creating a "cinematic".
Sent from my iPadŽ
im creating the program in another programming language. I am completly new at C++. All i need C++ for is to play the video file straight away thenonce its finished to continue back into the first language i was dealing with. The cinimatics are an avi or wmv format therefore if i can get something to run the video then im good. can't have play button ormenu or fast forwards or anything just needs to play
Last edited by blindstone; 11-06-2005 at 05:11 PM.
what language is the game in? Have you thought about playing the video in that language? DirectX has support for almost all windows programming languages so you might want to look into some DirectShow tutorials.
-"What we wish, we readily believe, and what we ourselves think, we imagine others think also."PHP Code:
sadf
>> what are you using as a complier? im using Dev-C++ and im getting errors on this code so <<
For Dev-C++, you need to link with the winmm library. You do this by adding "-lwinmm" to the linker box under Project->Project Options->Parameters (you need to create a new project and add the code as a C file, if you haven't already).
ok now i am getting
" cannot find -lobjc
ld returned 1 exit status
C:\Dev-Cpp\Makefile.win [Build Error] [Project1.exe] Error 1 "
It's not -lobjc it's -lwinmm.
Trinity: "Neo... nobody has ever done this before."
Neo: "That's why it's going to work."
c9915ec6c1f3b876ddf38514adbb94f0
i know, i placed the -lwinmm into the linker box, but the error i am reciving now is:
cannot find -lobjc
ld returned 1 exit status
C:\Dev-Cpp\Makefile.win [Build Error] [Project1.exe] Error 1