2

I'm about to start working on a custom cross platform engine (c++) that will need to be able to support the latest versions of both OpenGL and DirectX. The renderer is chosen before compilation.

I'm looking at cross platform libraries to handle window creation and input that can also handle the latest implementations of DX and OGL - preferably low profile and most importantly: fast. Any recommendations?

Thanks!

5 Answers 5

3

SDL is probably the most used cross-platform library for that kinda thing.

1
  • I've heard this is somewhat out of date?
    – oneminute
    Dec 23, 2010 at 4:52
3

You should check out SFML (Simple Fast Media Library). Although SDL is much more well-known due to its older age, SFML is far richer functionality- and design-wise, despite being only a few years old. It can essentially be described as a newer, more modern, and object-oriented SDL (it's C++; SDL is C).

To give you a brief overview of its features:

  • Cross-platform (Windows, Mac OS X, and Linux).
  • Has modules for system-related stuff (events, timers, etc), windowing, video (hardware-accelerated OpenGL 2D graphics), audio, and networking.
  • Supports all essential and mainstream image and audio file formats, with the notable exception of MP3 due to licensing issues (although this is available as an extension).
  • Also supports fonts (FreeType2 is integrated) and many other things.

I use it for all my projects that need more than just a command line and I love it. I highly recommend it.

It should be able to provide a good base for your idea.

2

wxWidgets.

1
  • This seems a little bloated for what I need - I just need window creation and event handling
    – oneminute
    Dec 23, 2010 at 4:50
1

The OpenGL and DirectX are somewhat similar yet very different. OpenGL is built with idea to forward developers desire to render to devices if available. DirectX is built with idea to make rendering capabilities of devices available for developer.

Thanks to differences you end up implementing almost everything twice. Manipulating windows is quite minor issue. You do not need exactly same windows since you will use one or another anyway for rendering in them.

It is perhaps best to use different things for creating the windows (like SDL for OpenGL and MS API for DirectX) and wrap it behind common interface. Then the "things" will be also chosen before compilation. Where MS API is not available there you will lack DirectX too, so no need to make it portable.

2
  • This is what I decided upon - functions named the same, using different namespaces for OGL and DX. Win32 API for DX and a cross platform lib for OGL. Thanks for the input
    – oneminute
    Dec 23, 2010 at 5:11
  • I've also decided to go with GLFW for the OpenGL side of things - it's more modern than SDL and does all I need it to
    – oneminute
    Dec 23, 2010 at 5:32
0

Irrlicht

Ogre

Both are fast and powerful. They fit great for games, if I'm getting right your intention.

1
  • Those are both great renderers (I've used them both) but I'm actually trying to write my own engine
    – oneminute
    Dec 23, 2010 at 4:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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