- Home /
Get the windows as textures to put in Unity3D.
Okay. I'm working on a 3D Pac-Man Cabinet in Unity3D. This will involve a MAME emulator. (Direct3D, I suppose)
My goal is to have Pac-Man from MAME window converted in a texture so I can able to use that texture into Pac-Man machine on Unity3D and play.
My Pac-Man cabinet:
MAME Emulator Window:
And yes, I have a CRT emulation applied, so it look like one of those old fashioned tube-TV using Direct3D feature.
Something like this: http://www.youtube.com/watch?v=TQWErKtfpq4&feature=youtu.be The code for the video above is for DirectX SDK: https://github.com/steeve/dwmaxx2
Is it possible to do something like this on Unity3D...? Eh? Thanks.
@L1ght3d - please don't post question 5 times. Until you have 15 karma points all of your question will go through moderation. It may be $$anonymous$$utes or hours before someone has a chance to approve a question.
Answer by Honorsoft · Sep 11, 2017 at 01:05 PM
Can't believe nobody's posted anything or responded to you so far. I am trying the same thing with Burgertime, lol. I am an experienced C++ programmer, but I'm still trying to learn what Unity can and can't do. Sadly, it would have been WAY easier to use a compiler and add Mame source to OpenGL source and make a 3D game that could play MAME inside the game. I'm not even sure yet if/how you can add libraries to Unity. Anyways, make sure it is worth it because it could end up being more work to incorporate MAME into Unity, instead of just re-creating a simple 8-bit arcade game and using that in Unity. I have found some file streaming and bitmap texture generation source for Unity (C#/JS), and I found MAME source that was already in C# format (although it is a CPS1 ONLY version, smaller in size than 'full' MAME). so I am still collecting code I'll need while I study Unity manuals. We will have to decide whether we want a full version of MAME inside Unity, or just the MAME source needed to run a specific game. If it's just for one game you will have to strip MAME down, so it's recommended you have prior experience compiling MAME from source, so that you know what you need and don't need. If you or anyone else has made progress with this, let me know. Right now I am looking through the MAME CPS1 source to find where they actually render the game screen, I'm planning on replacing that with my C# render-to-texture source for Unity. CPS1 doesn't play the games I want but that's the only C#/JS version I could find so far.
PS, $$anonymous$$eep in $$anonymous$$d that if you're planning an Android mobile version of the game you will need to use OpenGL ins$$anonymous$$d of DirectX.
Also, I have seen claims of $$anonymous$$A$$anonymous$$E being played inside Unity using assets from the Asset Store, but have seen/heard no real proof it works, plus I am looking for a free way to do it.
One last thing, also keep in $$anonymous$$d that you will likely need a fast computer (and your players will too) to play $$anonymous$$A$$anonymous$$E games inside Unity without lag. because $$anonymous$$A$$anonymous$$E already has lag emulating the arcade machine to Windows, then all those graphics, game data and input have to be passed back and forth to Unity.
Also, check ot LibRetro https://www.youtube.com/watch?v=6f2WEATXaok Supposed to be capable of running $$anonymous$$ame inside Unity, but all I see is GBA.
Answer by teknorapture · Mar 29, 2020 at 05:07 PM
WAY back in the day we used to use a DirectX Wrapper to launch a game such as Ultima Online. We then could draw directly to the game's window and get UI clicks back. My old programming supervisor and I wrote our own Macro/Cheat Machines for UO. Wouldn't something like that work? Also, I'm sure you can "add libraries to Unity" (More like add them to your C# Scripts.) This should be no harder than adding a JSON library which most of us almost always does.
There should be a similar OpenGl Wrapper somewhere too.
Plus, this scheme should help with the lag because the emulator would be running in parralel to Unity and not actually "inside" it.
Let me know if you ever figured this out, thanks!
Answer by Aledownload · Jul 02, 2020 at 09:30 AM
Hello, I was trying to code something like a virtual arcade, and found this post. Has the project gone somewhere in this years? Also, I'm quite new to Unity, please try to be clear, thanks.
Your answer
Follow this Question
Related Questions
Problem with GetNativeTextureID() Unity 3.5 on Windows 1 Answer
Textures OK in editor but bad in final build 2 Answers
Load texture on runtime on Windows and Mac 1 Answer
Loss of texture data when Unity 2.6 looses of focus on a windows App. 0 Answers
My T4 template tt file customtool changes when editor updates assets 0 Answers