Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Embedding an EXE into Another Window
#1
I was wondering if there is a way to to embed a program (say a game window) inside another.
What I am trying to achieve is to allow my C++ application to run other mini games' exes in its window.

Any thoughts?
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#2
On Windows you have the option of using parent and child windows: http://stackoverflow.com/questions/16626...in-windows

I would imagine there is a similar thing available on other platforms, but if you want to embed a mini game into a game I don't really see a reason to not just make it part of the source code.
Age ratings for movies and games (and similar) have never been a good idea.
One can learn a lot from reinventing wheels.
An unsound argument is not the same as an invalid one.
volatile in C++ does not mean thread-safe.
Do not make APIs unnecessarily asynchronous.
Make C++ operator > again
Trump is an idiot.
Reply
Thanks given by: Silverthorn , A-Man
#3
Thanks for the answer! Did some research, and apparently this can not be done easily especially if the 2 games use different graphical contexts.

As for why:
I wanted to have it possible to let other people add the minigames they wrote in their preferable language into the A-Engine. I believe the best solution is to clearly provide a place for such in the engine's source, and just let those who wish do it and compile the engine themselves.

Thanks a lot, nevertheless!
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#4
(02-08-2015, 12:18 PM)Doctor A Wrote:  I wanted to have it possible to let other people add the minigames they wrote in their preferable language into the A-Engine.

My guess is, in order to realize something like that, you'd have to provide some kind of API that bridges possibly different contexts of the applications. Seems like quite some hassle and I really would not recommend that :p

Alternatively, launch the "embedded" programs on their own. Ie. once a certain trigger is activated in your program, it will essentially just "run app.exe". That doesn't look too great, though, so idk :p
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by: A-Man
#5
(02-08-2015, 12:34 PM)Blue Phoenix Wrote:  My guess is, in order to realize something like that, you'd have to provide some kind of API that bridges possibly different contexts of the applications. Seems like quite some hassle and I really would not recommend that :p
Yes, definitely. There could be the following:
-A loadImg(directory) function that loads an image and returns its Texture object where:
---Texture.render(x, y) function renders the texture in (x,y).
---Texture.setColorKey(red, green, blue) sets the colorkey for the texture.
---Texture.moveTo(x, y) moves the texture to (x, y)
---Texture.translate(x, y) translates the texture's geometry by x and y.
---Texture.rotate(angle, center_x, center_y) rotates the texture's geometry by the angle "angle" with (center_x, center_y) being the center.
---Texture.stretch(x_factor, y_factor, center_x, center_y) stretches the geometry by the x, y factors from the center given.
---Texture.shear(x_factor, y_factor, center_x, center_y) shears the geometry by the x, y factors from the center given.
---Texture.reflect(on_x, on_y, center_x, center_y) on_x and on_y being boolean values. Reflects about the center given.
---Texture.resetGeometry() resets the sprite's geometry to normal.
-A loadSound(directory) function that loads a sound file and returns its Sound object where:
---Sound.play() plays the sound
-A loadMusic(directory) function that loads a music file (mp3, ogg..etc) and return its Music object where:
---Music.play(times) plays the music "times" time from the beginning.
---Music.pause() pauses the current running music.
---Music.resume() resumes the paused music.
---Music.setVolume(volume) sets the volume to "volume" (out of a 120).
-A GetCursorPosition() function to get the position of the cursor.
-A isKeyHeld(KeyEnumValue, player_number) function that returns true if the key of the corresponding player is held.
-A isKeyPressed(KeyEnumValue, player_number) function that returns true if the key of the corresponding player  was pressed in the current frame.
-A complement() function that does the rest of the stuff behind the scenes (FPS controlling, checking for events..etc..etc).

Maybe also supply it with more collision detection related functions.
Stuff should be python level of clear if you've made even a single game in your life.


Quote:Alternatively, launch the "embedded" programs on their own. Ie. once a certain trigger is activated in your program, it will essentially just "run app.exe". That doesn't look too great, though, so idk :p
Would be awesome if it would remove the app's frame and move it to the A-Engine's window center, but then it would not feel as professional once it's figured out :P.
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)