0
\$\begingroup\$

I've picked up one old open source game (done with C++/Lua) with a lot of features and chosen to continue its development. It use SDL2 (ported by me from 1.2) and OpenGL 2.0. Now when I look at futher development it seems that mobile platforms don't support legacy OpenGL stuff, which is used really heavily: entire arhitecure is based on calling gl functions from lua side, where rendering functions are specified.

I'm not quite a pro in 3D development, so I'm not sure is it easier to change current architecture to modern OpenGL or re-write all the stuff. There are some other architecture problems (not GL related ones).

So, is it better to try changing exsisting architecture or start all from scatch, using modern stuff like OpenGL 3.1+ or Vulcan?

\$\endgroup\$
  • 2
    \$\begingroup\$ This looks to me like it may boil down to opinion, and your personal development style. I'm not sure if we can deduce a "correct" answer based on the information we have. If there's a particular bit of example code you could use as a focus, we might be able to reframe the question as "how can I update [this specific feature] to use modern OpenGL?" \$\endgroup\$ – DMGregory Jan 1 at 20:59
  • \$\begingroup\$ @DMGregory As I said, most of rendering is done from lua with bridged stuff like glBegin()/glEnd(), glNormal3f(). If I got things right, in modern GL all stuff should be done using VBO and shaders. \$\endgroup\$ – val says Reinstate Monica Jan 1 at 21:16
  • 2
    \$\begingroup\$ You could rewrite glBegin/glEnd and related functions on top of shaders+VBOs. This could be easier than restructuring the entire game. \$\endgroup\$ – HolyBlackCat Jan 1 at 21:37
1
\$\begingroup\$

Depending on your situation this may be a matter of preference. That being said, we can attempt to break the problem down somewhat objectively.

First off, you mentioned a concern about mobile platforms not supporting legacy OpenGL. Objectively, you can re-frame that as:

  • Will the existing game engine currently work on your target platforms?

If the answer is no, then either you need to rework / replace the engine OR adjust to target platform expectations.

If the answer is yes, then the next thing to consider is:

  • Will the engine work on the target platforms for the duration that you expect to support the game?

Again, if the answer is no, then either you need to rework / replace the engine OR adjust to your expectations regarding how long the game will be viable.

There are some other factors you may wish to consider. If your personal goal is to learn modern OpenGL, then sinking time into a legacy development doesn't make sense. And as pointed out in the comments, transitioning the engine to use modern OpenGL might be easier than rewriting it from scratch.

Finally, while modern OpenGL is likely to be more performant for modern games and the demands they place on GPUs, modern video cards are typically fast enough to handle the legacy OpengGL from older games, in part due to the fact that the graphics expectations were lower. If those expectations aren't good enough for you (i.e. you want to render the game in 4k, use high resolution textures, support VR, etc) then you'll need to weigh the expense of finding ways to execute those objective in legacy OpenGL against the expense of porting or rewriting to support the modern APIs.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.