Happy New Year! Forget all that stuff about the Mayan Calendar. Be Cool!

Latest Reviews & Tutorials

  • GhostBSD 2.5 review
  • How to install Takeoff Launcher on Fedora 16 KDE
  • Install Quick Access on Linux Mint 12 KDE or any KDE installation
  • How to install Linux Mint 12 KDE on a btrfs file system
  • Manual disk partitioning guide for Linux Mint 12 KDE
  • How to compile and install Takeoff Launcher on Linux Mint 12 KDE
  • 3 must-have extensions for Fedora 16 and other GNOME 3 installations
  • How to install Razor-qt on Linux Mint 12 KDE
  • How to enable desktop slideshow on Linux Mint 12 KDE
  • KahelOS 111111 review
  • How to install Cinnamon in Ubuntu 11.10
  • How to customize Cinnamon on Fedora 16 and Linux Mint 12
  • How to install Cinnamon on Fedora 16
  • What does Cinnamon bring to the desktop?
  • How to access Microsoft Windows files and folders from Linux
  • How to dual-boot Pear OS Panther 3 and Windows 7
  • How to dual-boot Chakra Linux Edn and Windows 7, part 1
  • Linpus Lite Desktop 1.6 review
  • Chakra GNU/Linux Edn 2011.12 review
  • How to customize Pear OS Linux Panther 3

Qt Graphics and Performance – OpenGL


Introduction

Here’s the next instalment of the graphics performance blog series. We’ll begin by looking at some background about how OpenGL and QPainter work. We’ll then dive into how the two are married together in OpenGL 2 Paint Engine and finish off with some advice about how to get the best out of the engine. Enjoy!

Why OpenGL?

Before I dive into the OpenGL paint engine, I want to make sure we all understand the motivation for the OpenGL 2.0 paint engine. I’ve talked about this before in my article about hardware acceleration, but we still frequently get questions like “Why not implement a Direct2D paint engine?”.

Everyone knows OpenGL means fast graphics right? Well, this is actually a bit of a misconception. What makes graphics fast is a bit of hardware dedicated to computer graphics called a GPU (Graphics Processing Unit). OpenGL 2.x is a software library which often (but not always) uses a particular class of GPU to help satisfy drawing operations (Note: OpenGL 1.x used a different class of GPU). A modern programmable GPU (e.g. nVidia GTX 295) can usually be programmed via both OpenGL, Direct3D and OpenCL. The only difference then is that Direct3D is only available on the Windows platform and OpenCL is not universally supported.

So the reason we are investing our time and effort into OpenGL, rather than Direct3D or OpenCL, is that OpenGL 2.0 is sufficient to give us access to all the GPU features we currently want to use. It is also available on more platforms, especially if you limit yourself to the ES sub-set. We are also looking into restricting ourselves further to only use APIs in OpenGL 3.2 Core Profile.

This might change in the future if we see a new class of GPU, like ones designed for 2D vector graphics which can’t be abstracted by OpenGL 2.0 very well (enter OpenVG), or, if we want to start using GPU features which OpenGL (ES) 2.0 doesn’t give us access to. Having said that, OpenGL is very good at exposing new GPU features through extensions.

History

Qt has had an OpenGL paint engine since early Qt 4.0 days. This engine was designed for the fixed-function hardware available at the time. As time went on and manufacturers added newer bits of hardware to their GPUs, the OpenGL paint engine was adapted to use those features through OpenGL extensions. Over the last 4 years, lots of people have hacked on the engine and added support for things like ARB fragment programs and even adapted the engine to work on OpenGL ES 1.1. The engine is pretty stable and has lots of fall-backs (or original code-paths, depending on how you look at them) for old hardware missing GL extensions the engine can utilise. But, fundamentally, it is an OpenGL 1.x engine. Continue reading.

0saves
To have articles like this delivered automatically to your Feed Reader or Inbox, subscribe via RSS or email. For simple comments, use the commenting system, but for more involved assistance, please use the Question & Answer section.

Posts From The Same Category:




Questions & Answers Hola! Looking for an answer to a question but did not find it? Then surf on over to the Questions & Answers section. It's a brand new addition to our site, and we are waiting just to answer your question(s).

Leave a Reply

Trackbacks

Read previous post:
The Economic Case for Open Source Foundations
Linux Mint 8 review
Privacy by Design: The 7 Foundational Principles
Close