I'm thinking of trying to make a game, and I heard Facebook is good place to make it popular, but I don't want to make a sprite-based Flash game, I want to use OpenGL for rendering to get nice graphics and good performance with it.

I know there is Java which supports OpenGL (I think), but I would like to make my game closed-source so that people cannot make their own mods for it like what happened with Minecraft.

Another option I thought was to make OpenGL executable and a Flash version, but I think it might be too much work for one guy. Not to mention I have never done anything in Flash.

So, is there any way to develop closed-source game that can be also played through a browser? By closed-source I mean the people have no way of getting the source code by decompiling it in any way.

  • \$\begingroup\$ Why are you so eager to protect your code? There's a way to reverse engineer almost anything you put online... but why would anybody want to do that in the first place? \$\endgroup\$
    – bummzack
    Dec 8, 2011 at 13:13
  • \$\begingroup\$ @bummzack, because i work alone, probably someone just steals my code and finishes the game before me... :/ \$\endgroup\$
    – idev
    Dec 8, 2011 at 13:15
  • \$\begingroup\$ @idev hik! So why do you think people post their thoughts or ideas on internet? (unless you are a non-male :P) \$\endgroup\$ Dec 8, 2011 at 13:58
  • \$\begingroup\$ @iamcreasy, im not sure whats your point? stealing an idea is a lot more work for making it into a complete product, than just stealing the half-complete (or complete) product and putting new gfx on it and call it your product. i dont know why people post their game ideas on the web, i dont do that, maybe they just want attention? i only discuss them privately with some friends. \$\endgroup\$
    – idev
    Dec 8, 2011 at 14:12
  • 2
    \$\begingroup\$ maybe i just need to finish my game before showing it to anyone lol. \$\endgroup\$
    – idev
    Dec 8, 2011 at 17:13

2 Answers 2


Something will only get popular on Facebook if you build all the Facebook infrastructure, ie. a website with various links into the Facebook API to allow people to log in, share links, comment on it, etc. It's probably not worth the effort unless you have a specific reason to want to use the Facebook system.

To have something playable on the web and also as an executable, and to directly use OpenGL, then pretty much your only choice right now is Java. You can get accelerated 3D in the browser with Unity, but you don't have low level OpenGL access. And Flash's 3D support is rapidly becoming usable, but I don't know how you access those APIs.

  • \$\begingroup\$ why i want windows application is because i dont like playing a game on a browser... i want any size window i wish. but because i have heard that people like playing on a browser, i have thought i really need to offer this possibility, since it seems like that is what makes facebook games so popular. but i still want to play the game like it was any other windows game. \$\endgroup\$
    – idev
    Dec 8, 2011 at 14:17
  • \$\begingroup\$ doesnt c#/.net work also cross-platform, thus, isnt there a "Java" equivalent for them, to embed them on webpage too? im sure i have seen some games that arent Java nor Flash... (nor webgl) might be wrong though. \$\endgroup\$
    – idev
    Dec 8, 2011 at 14:19
  • \$\begingroup\$ If you don't like "one window size" then build your app to be responsive so that it grows with the browser or shrinks with the browser. difficult and more work yes, but solves your problem. \$\endgroup\$ Dec 8, 2011 at 18:53
  • \$\begingroup\$ @Jack, that could work, but not without OpenGL or DirectX rendering. unless i want to experience huge lagging... \$\endgroup\$
    – idev
    Dec 14, 2011 at 12:56

If you ever reconsider the closed-source approach, then I think JavaScript and WebGL are what you need. I have a few randomly picked arguments for you:

  • JavaScript can be obfuscated to a point where it's not worth reverse-engineering, simply because it can be redone in less time.
  • don't think your code is worth much, it's your idea that will be copied, and what you will achieve alone in 2 years will be redone by a team of six in less than 4 months.
  • even if you ship compiled code, you will have a hard time preventing anyone from modifying your assets.

If you really don't want to go that way, I have never used it myself, but haXe was recommended to me several times including very recently. It is a high-level language similar to ActionScript that compiles to JavaScript, Flash, C++ and more. It has OpenGL bindings that alas do not appear to be maintained.

My personal expectation is that solutions such as Google's NativeClient will some day become the norm, because that will make a fantastic amount of code portable to web applications. Right now I can write OpenGL ES code with NaCl that runs at native speed and I am extremely satisfied with the very little amount of code I had to change. The Ogre engine was successfully ported to NaCl. The drawback is that the code only works in Chrome, and the Mozilla developers have made it clear that they don't want NaCl in Firefox.

  • \$\begingroup\$ hurr, i get creeps from hearing obfuscated javascript. you are right though, the code isnt worth much, especially with my skills. maybe i should just write the game and release it public only when its enough finished, so i have a good head start from any company taking over. then i will at least make some money with it and not be so disappointed even if someone copies my idea, which i have seen happens to almost every game out there. i think i just make windows executable and move on facebook later if i get any success. i could write the facebook version later. \$\endgroup\$
    – idev
    Dec 8, 2011 at 17:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .