Giter Site home page Giter Site logo

qt-ogre-widget's Introduction

Qt-Ogre-Widget

Embed OGRE into a QtWidget in a cross compatible way. This widget has been tested on Ubuntu 12.04 LTS, Ubuntu 14.04 LTS and Mac OS X 10.9. Additional requirements:

  • Qt 5.1
  • OGRE 1.9

Usage

This project can be compiled as a library. Extend one of your classes with the QtOgre::WindowEventListener interface and implement all abstract methods. Last bootstrap the window like this:

int main(int argc, char** argv) {
	try {
		QApplication app(argc, argv);

		QtOgre::WindowEventListener *listener = new MyWindowEventListener;
		QtOgre::QOgreWindow window(listener);
		window.show();

		return app.exec();
	} catch(const std::exception &ex) {
		// Error
		std::cerr << ex.what() << std::endl;
	}
}

Use the abstract method onSetup() to proceed with your code after the window has been created.

Why does this repository exist?

When I was starting to use OGRE, I needed a cross compatible way of handling a window to host OGRE inside of. Instead of using preprocessor if-else statements with Objective-C I decided to use Qt instead. There are a ton of information about integrating Qt into OGRE but I found it extremely hard to find a guide that worked, probably because many of them are outdated. The code might not be optimized and there might be tons of better ways to do it, but this is the result of what worked for me. I created this repository in the hopes that it could help others in the future.

Credit

I take no credit to the code inside this repository. Thanks to:

I am not claiming that the code in the links above does not work, I might have been doing something wrong.

qt-ogre-widget's People

Contributors

ekman avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.