oneminute
oneminute

Reputation: 117

Cross platform window library - Integrating OpenGL and DirectX

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!

Upvotes: 2

Views: 5382

Answers (5)

delaccount992
delaccount992

Reputation: 1323

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.

Upvotes: 3

Öö Tiib
Öö Tiib

Reputation: 10979

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.

Upvotes: 1

OneOfOne
OneOfOne

Reputation: 99234

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

Upvotes: 3

Septagram
Septagram

Reputation: 9785

Irrlicht

Ogre

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

Upvotes: 0

Android Eve
Android Eve

Reputation: 14974

wxWidgets.

Upvotes: 2

Related Questions