Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Creating standalone of specific RenderWindow  (Read 3275 times)

0 Members and 1 Guest are viewing this topic.

orella

  • Newbie
  • *
  • Posts: 10
    • View Profile
Creating standalone of specific RenderWindow
« on: April 24, 2017, 04:41:16 pm »
Hi!

Image that I have 2 RenderWindow. One with the game I'm developing and one with a button. How can I do to create a standalone (.exe file) of the game when i press that button?

Thanks

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Creating standalone of specific RenderWindow
« Reply #1 on: April 25, 2017, 09:58:22 am »
What exactly are you trying to do?

orella

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Creating standalone of specific RenderWindow
« Reply #2 on: April 25, 2017, 09:34:30 pm »
What exactly are you trying to do?

I'm creating a game engine like Unity. And in Unity (i'm sure you know it) you have an scene where you create your game placing gameObjects and when you want to build your game then just clik on Build option and an standalone is created on the project folder. And this is what i want to do on my engine.

PS: My engine scene is a RenderTexture where i draw the gameObjects sprites.
« Last Edit: April 25, 2017, 09:41:58 pm by orella »

sjaustirni

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: Creating standalone of specific RenderWindow
« Reply #3 on: April 25, 2017, 09:58:07 pm »
I'm creating a game engine like Unity.

Sounds.. bold :D

Anyway, back to your original question - it depends on how your engine is used. For instance, if in your engine one writes C++, you simply start gcc/clang on the user's project including your API headers, statically link your library to it and then you embed the assets into the exe. If one uses a scripting language, you could write your own compiler with bytecode generaton (LLVM is there to save you), or the exe could be just an interpreter with the scripts embedded in the exe and ran everytime the interpreter is clicked on, or you could compile the scripting language to C/C++ and then go the gcc/clang path.

And I just scratched surface on this one. I need to stress, however, that none of these are an easy thing to do, even though the first one is the easiest one by a large margin.

orella

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Creating standalone of specific RenderWindow
« Reply #4 on: April 26, 2017, 12:29:31 am »
When i say "like Unity" i mean that the way it works is similar. It have a scene where you place/create the gameObjects, you can add components to them and scripts, etc. But it's only 2D. Obviously it's far from being like Unity ;D.

The engine is made in c++ using visual studio and the scripts you can add in gameObjects will be also in c++;
« Last Edit: April 26, 2017, 12:38:44 am by orella »

DeathRay2K

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Re: Creating standalone of specific RenderWindow
« Reply #5 on: April 26, 2017, 03:32:05 pm »
You probably want to create a separate program that can take as input what the design program outputs. So for example, you might use your design software to write some scripts, include some resources, and set up everything you want the game to do. Then to create a distributable, you would export that data alongside a second program that can read, interpret, and execute those scripts, using the resources, etc.
That's what I would do, rather than trying to write or include a compiler.
This won't be as fast as a compiled project, but I think it will be a whole lot easier to put together.