X Window Programming/Print model – Wikibooks, open books for an open world

X Window Programming/Print version - Wikibooks, open books for an open world

Easy DirectMedia Layer (SDL) is a cross-platform multimedia library written in C that creates an abstraction over numerous platforms’ graphics, sound, and enter APIs, permitting a developer to put in writing a pc recreation or different multimedia software as soon as and run it on many working methods together with GNU/Linux, Microsoft Home windows and MacOS X. It manages video, occasions, digital audio, CD-ROM, sound, threads, shared object loading, networking and timers.

Sam Lantinga created the library, first releasing it in early 1998, whereas working for Loki Software program. He received the concept whereas porting a Home windows software to Macintosh. He then used SDL to port Doom to BeOS. A number of different free libraries appeared to work with SDL, akin to SMPEG and OpenAL.

The SDL library has bindings with nearly each programming language there’s, from the favored (C++, Perl, Python (by pygame), Pascal and many others.) to the much less identified (akin to Euphoria or Pliant). This and the truth that it’s open-source and licensed below the LGPL make SDL a standard alternative for lots of multimedia purposes.

SDL itself may be very easy; it merely acts as a skinny, cross-platform wrapper, offering assist for 2D pixel operations, sound, file entry, occasion dealing with, timing, threading, and extra. OpenGL is commonly used with SDL to supply quick 3D rendering. It’s typically considered a cross-platform DirectX, though it lacks a few of its extra superior performance. SDL as a substitute has an enormous variety of third social gathering extensions that make it straightforward to do extra superior features.

The library is split into a number of subsystems, particularly the Video (handles each floor features and OpenGL), Audio, CD-ROM, Joystick and Timer subsystems. Apart from this fundamental, low-level assist, there are also a number of SDL-dependent libraries that present some further performance. These embrace SDL_image (supplies a straightforward option to load in the present day’s commonest picture codecs), SDL_mixer (advanced audio features, primarily for sound mixing), SDL_net (networking assist), SDL_ttf (TrueType Font rendering assist), SDL_gfx (some further graphical features, akin to picture resizing and rotating) and SDL_rtf (easy Wealthy Textual content Format rendering).

A really fundamental SDL program. It hundreds SDL subsystems, pauses for two seconds, closes SDL, then exits this system.

That’s simply compiled and ran below Linux with “gcc `sdl-config –cflags –libs` -O3 mandelbrot.c && ./a.out”, on Home windows it is the identical, however you must use MinGW to compile it.


OpenGL (Open Graphics Library) is an ordinary specification defining a cross-language cross-platform API for writing purposes that produce 3D laptop graphics (and 2D laptop graphics as properly). The interface consists of over 250 totally different perform calls which can be utilized to attract advanced three-dimensional scenes from easy primitives. OpenGL was developed by Silicon Graphics and is widespread within the video video games business, the place it competes with Direct3D on Microsoft Home windows platforms. OpenGL is extensively utilized in computer-aided design, digital actuality, scientific visualization, info visualization, flight simulation, and online game improvement.


At its most elementary degree, OpenGL is a specification, which means it’s merely a doc that describes a set of features and the exact behaviors that they have to carry out. From this specification, {hardware} distributors create implementations — libraries of features created to match the features acknowledged within the OpenGL specification, making use of {hardware} acceleration the place attainable. {Hardware} distributors have to satisfy particular exams to have the ability to qualify their implementation as an OpenGL implementation.

Environment friendly vendor-supplied implementations of OpenGL (making use of graphics acceleration {hardware} to a higher or lesser extent) exist for Mac OS, Microsoft Home windows, Linux, many Unix platforms, Wii and PlayStation 3. Varied software program implementations exist, bringing OpenGL to quite a lot of platforms that don’t have vendor assist. Notably, the open supply library Mesa is a completely software-based graphics API which is code-compatible with OpenGL. Nonetheless to keep away from licensing prices related to formally calling itself an OpenGL implementation, it claims merely to be a “very comparable” API.

The OpenGL specification is presently overseen by the OpenGL Structure Overview Board (ARB), which was shaped in 1992. The ARB consists of a set of corporations with a vested curiosity in making a constant and extensively obtainable API. Voting members of the ARB as of April 2006 embrace 3D {hardware} producers Silicon Graphics, 3Dlabs, ATI Applied sciences, NVIDIA and Intel, and laptop producers IBM, Apple Laptop, Dell, and Solar Microsystems. Microsoft, one of many founding members, left in March 2003. Apart from these firms, every year many different corporations are invited to be a part of the OpenGL ARB for one-year phrases. With so many corporations concerned with such a various set of pursuits, OpenGL has turn out to be very a lot a general-purpose API with a variety of capabilities.

In line with present plans, management of OpenGL will go to the Khronos Group by the tip of 2006. That is being performed so as to enhance the advertising of OpenGL, and to take away obstacles between the event of OpenGL and OpenGL ES.[1]

Kurt Akeley and Mark Segal authored the unique OpenGL specification. Chris Frazier edited model 1.1. Jon Leech edited variations 1.2 by the current model 2.0.


OpenGL serves two primary functions:

  • To cover the complexities of interfacing with totally different 3D accelerators, by presenting the programmer with a single, uniform API.
  • To cover the differing capabilities of {hardware} platforms, by requiring that every one implementations assist the total OpenGL characteristic set (utilizing software program emulation if vital).

OpenGL’s fundamental operation is to simply accept primitives akin to factors, strains and polygons, and convert them into pixels. That is performed by a graphics pipeline referred to as the OpenGL state machine. Most OpenGL instructions both situation primitives to the graphics pipeline, or configure how the pipeline processes these primitives. Previous to the introduction of OpenGL 2.0, every stage of the pipeline carried out a hard and fast perform and was configurable solely inside tight limits however in OpenGL 2.Zero a number of phases are absolutely programmable utilizing GLSL.

OpenGL is a low-level, procedural API, requiring the programmer to dictate the precise steps required to render a scene. This contrasts with descriptive (aka scene graph or retained mode) APIs, the place a programmer solely wants to explain a scene and may let the library handle the small print of rendering it. OpenGL’s low-level design requires programmers to have a superb data of the graphics pipeline, but additionally provides a certain quantity of freedom to implement novel rendering algorithms.

OpenGL has traditionally been influential on the event of 3D accelerators, selling a base degree of performance that’s now widespread in consumer-level {hardware}:

  • Rasterised factors, strains and polygons as fundamental primitives
  • A rework and lighting pipeline
  • Z-buffering
  • Texture mapping
  • Alpha mixing

Many trendy 3D accelerators present performance far above this baseline, however these new options are usually enhancements of this fundamental pipeline quite than radical reinventions of it.


We first clear the colour buffer, so as to begin with a clean canvas:


We now set the modelview matrix, which controls the place of the digital camera relative to the primitives we render. We transfer it backwards Three items alongside the Z axis, which leaves it pointing in the direction of the origin:

glMatrixMode( GL_MODELVIEW );       /* Subsequent matrix instructions will have an effect on the modelview matrix */
glLoadIdentity();                   /* Initialize the modelview to identification */
glTranslatef( 0, 0, -3 );           /* Translate the modelview Three items alongside the Z axis */

The projection matrix governs the angle impact utilized to primitives, and is managed in the same option to the modelview matrix:

glMatrixMode( GL_PROJECTION );      /* Subsequent matrix instructions will have an effect on the projection matrix */
glLoadIdentity();                   /* Initialize the projection matrix to identification */
glFrustum( -1, 1, -1, 1, 1, 1000 ); /* Apply a perspective-projection matrix */

Lastly, we situation a polygon – a inexperienced sq. oriented within the XY aircraft:

glBegin( GL_POLYGON );              /* Start issuing a polygon */
glColor3f( 0, 1, 0 );               /* Set the present colour to inexperienced */
glVertex3f( -1, -1, 0 );            /* Situation a vertex */
glVertex3f( -1, 1, 0 );             /* Situation a vertex */
glVertex3f( 1, 1, 0 );              /* Situation a vertex */
glVertex3f( 1, -1, 0 );             /* Situation a vertex */
glEnd();                            /* End issuing the polygon */


OpenGL’s recognition is partially as a result of excellence of its official documentation. The OpenGL ARB launched a collection of manuals together with the specification which have been up to date to trace modifications within the API. These are nearly universally identified by the colours of their covers:

  • The Crimson Guide – The OpenGL Programmer’s information. ISBN 0-321-33573-2
    A readable tutorial and reference guide – this can be a ‘should have’ guide for OpenGL programmers.
  • The Blue Guide – The OpenGL Reference handbook. ISBN 0-321-17383-X
    Primarily a hard-copy printout of the person pages for OpenGL.
    Features a poster-sized fold-out diagram displaying the construction of an idealized OpenGL implementation.
  • The Inexperienced Guide – Programming OpenGL for the X Window System. ISBN 0-201-48359-9
    A guide about X11 interfacing and GLUT.
  • The Alpha Guide (which really has a white cowl) – OpenGL Programming for Home windows 95 and Home windows NT. ISBN 0-201-40709-4
    A guide about interfacing OpenGL with Microsoft Home windows.

Then, for OpenGL 2.Zero and past:

  • The Orange Guide – The OpenGL Shading Language. ISBN 0-321-33489-2
    A readable tutorial and reference guide for GLSL.


The OpenGL normal permits particular person distributors to supply further performance by extensions as new expertise is created. Extensions could introduce new features and new constants, and will chill out or take away restrictions on present OpenGL features. Every vendor has an alphabetic abbreviation that’s utilized in naming their new features and constants. For instance, NVIDIA’s abbreviation (NV) is utilized in defining their proprietary perform glCombinerParameterfvNV() and their fixed GL_NORMAL_MAP_NV. It might occur that a couple of vendor agrees to implement the identical prolonged performance. In that case, the abbreviation EXT is used. It might additional occur that the Structure Overview Board “blesses” the extension. It then turns into referred to as a normal extension, and the abbreviation ARB is used. The primary ARB extension was GL_ARB_multitexture, launched in model 1.2.1. Following the official extension promotion path, multitexturing is now not an optionally carried out ARB extension, however has been part of the OpenGL core API since model 1.3.

Earlier than utilizing an extension a program should first decide its availability, after which acquire tips to any new features the extension defines. The mechanism for doing that is platform-specific and libraries akin to GLEW and GLEE exist to simplify the method.

Specs for practically all extensions may be discovered on the official extension registry [1].

Related utility libraries[edit]

A number of libraries are constructed on high of or beside OpenGL to supply options not obtainable in OpenGL itself. Libraries akin to GLU can at all times be discovered with OpenGL implementations, and others akin to GLUT and SDL have grown over time and supply rudimentary cross platform windowing and mouse performance and if unavailable can simply be downloaded and added to a improvement surroundings. Easy graphical consumer interface performance may be present in libraries like GLUI or FLTK. Nonetheless others libraries like AUX are deprecated libraries which have been outdated by performance generally obtainable in additional widespread libraries, however code nonetheless exists on the market notably in easy tutorials. Different libraries have been created to supply OpenGL software builders a easy technique of managing OpenGL extensions and versioning, examples of those libraries embrace GLEW “The OpenGL Extension Wrangler Library” and GLEE “The OpenGL Straightforward Extension library”.

Along with the aforementioned easy libraries different larger degree object oriented scene graph retained mode libraries exist akin to PLIB, OpenSG, OpenSceneGraph, and OpenGL Performer, these can be found as cross platform Open Supply or proprietary programming interfaces written on high of OpenGL and methods libraries to allow the creation of real-time visible simulation purposes.

Mesa 3D ([2]) is an Open Sourced implementation of OpenGL. It helps pure software program rendering in addition to offering {hardware} acceleration for a number of 3D graphics playing cards below Linux. As of February 2 2006 it implements the 1.5 normal, and supplies a few of its personal extensions for some platforms.


In an effort to emphasize its multi-language and multi-platform traits, numerous bindings and ports have been developed for OpenGL in lots of languages. Most notably, the Java 3D library can depend on OpenGL for its {hardware} acceleration. Direct bindings are additionally obtainable just like the Light-weight Java Recreation Library which has a direct binding of OpenGL for Java and different recreation associated parts. Very just lately, Solar has launched beta variations of the JOGL system, which supplies direct bindings to C OpenGL instructions, not like Java 3D which doesn’t present such low degree assist. The OpenGL official web page [3] lists numerous bindings for Java, Fortran 90, Perl, Pike, Python, Ada, Delphi and Visible Primary. Bindings are additionally obtainable for C++ and C#, see [4].

Greater degree performance[edit]

OpenGL was designed to be graphic output-only: it supplies solely rendering features. The core API has no idea of windowing methods, audio, printing to the display screen, keyboard/mouse or different enter units. Whereas this appears restrictive at first, it permits the code that does the rendering to be fully unbiased of the working system it’s operating on, permitting cross-platform improvement. Nonetheless some integration with the native windowing system is required to permit clear interplay with the host system. That is carried out by the next add-on APIs:

  • GLX – X11 (together with community transparency)
  • WGL – Microsoft Home windows

Moreover the GLUT and SDL libraries present performance for fundamental windowing utilizing OpenGL, in a transportable method. MacOS X has three APIs to get OpenGL assist: AGL for Carbon, NSOpenGL for Cocoa and CGL for lower-level entry.

Historical past[edit]

Right now the digital era of animated scenes in three dimensions is an everyday fixture in on a regular basis life. Scientists make the most of laptop graphics to investigate simulations of each chance. Engineers and designers design digital fashions utilizing laptop graphics. Films make use of laptop graphics to create beautiful particular results or whole animated movies. And over the previous few years, laptop video games have introduced laptop graphics expertise to common customers, utilizing graphics to carry their gamers into worlds that might by no means exist.

Bringing digital graphics expertise to such widespread use was not with out its challenges. Fifteen years in the past, growing software program that might perform with a variety of graphics {hardware} and all of their totally different interfaces was time consuming. Every group of programmers developed interfaces individually, and there was consequently a lot duplicated code. This was hindering the rising business of laptop graphics.

By the early 1990’s SGI, a pacesetter in 3D graphics, and its programming API, IrisGL, had turn out to be a defacto business normal, over-shadowing the open-standards-based PHIGS. The IrisGL programming interface (API) was elegant, easy-to-use, and, importantly, supported immediate-mode rendering. Against this, PHIGS was clunky, laborious to make use of, and was a number of generations behind IrisGL in perform and functionality, primarily because of the dysfunctional PHIGS standardization course of. None-the-less, competing distributors, together with Solar Microsystems, Hewlett-Packard and IBM had been capable of carry to market credible 3D {hardware}, supported by proprietary extensions to PHIGS. By the early 90’s, 3D graphics {hardware} expertise was pretty properly understood by numerous rivals and was now not a discriminating consider laptop methods purchases. Thus, quite than prolonging a contentious and harmful combat between IrisGL and PHIGS, SGI sought to show a defacto normal into a real open normal.

The IrisGL API itself wasn’t appropriate for opening (though it had been beforehand licensed to IBM and others), partially as a result of it had accrued cruft through the years. For instance, it included a windowing, keyboard and mouse API, partially as a result of it was developed earlier than the X11 Window System versus Solar’s NeWS battle had resolved. Thus, the API to be opened wanted to be cleaned up. As well as, IrisGL had a big software program vendor (ISV) portfolio; the change to the OpenGL API would preserve ISV’s locked onto SGI (and IBM) {hardware} for a number of years whereas market assist for OpenGL matured. In the meantime, SGI would proceed to attempt to preserve a vendor lock by pushing the higher-level and proprietary Iris Inventor and Iris Performer programming API’s.

The end result is called OpenGL. OpenGL standardized entry to {hardware}, and pushed the event duty of {hardware} interface applications, generally known as system drivers, to {hardware} producers and delegated windowing features to the underlying working system. With so many various sorts of graphic {hardware}, getting all of them to talk the identical language on this approach had a exceptional impression by giving software program builders a better degree platform for 3D-software improvement.

In 1992, SGI led the creation of the OpenGL architectural overview board (OpenGL ARB), the group of corporations that will preserve and increase the OpenGL specification for years to come back. OpenGL advanced from (and may be very comparable in type to) SGI’s earlier 3D interface, IrisGL. One of many restrictions of IrisGL was that it solely supplied entry to options supported by the underlying {hardware}. If the graphics {hardware} didn’t assist a characteristic, then the appliance couldn’t use it. OpenGL overcame this downside by offering assist in software program for options unsupported by {hardware}, permitting purposes to make use of superior graphics on comparatively low-powered methods.

In 1994 SGI performed with the concept of releasing one thing known as “OpenGL++” which included parts akin to a scene-graph API (presumably primarily based round their Performer expertise). The specification was circulated amongst a number of events – however by no means become a product.

When Direct3D was launched in 1995, Microsoft, SGI, and Hewlett-Packard initiated the Fahrenheit challenge, which was a joint effort with the purpose of unifying the OpenGL and Direct3D interfaces – and once more, including a scene-graph API. It initially confirmed some promise of bringing order to the world of interactive 3D laptop graphics APIs, however on account of monetary constraints at SGI and common lack of business assist it was deserted. The engineers concerned at SGI held a seashore social gathering in celebration – full with bonfires on which they burned piles of Fahrenheit documentation.

OpenGL 2.0[edit]

OpenGL 2.Zero was conceived by 3Dlabs to deal with issues that OpenGL was stagnating and lacked a powerful route. 3Dlabs proposed a lot of main additions to the usual, probably the most vital of which was GLSL (the OpenGL Shading Language, additionally slang). This may allow the programmer to interchange the OpenGL fixed-function vertex and fragment pipelines with shaders written in a C-like language, massively increasing the vary of graphical results attainable. GLSL was notable for making comparatively few concessions to the restrictions of the {hardware} then obtainable; this hearkened again to the sooner custom of OpenGL setting an bold, forward-looking goal for 3D accelerators quite than merely monitoring the state of presently obtainable {hardware}. The ultimate OpenGL 2.Zero specification [5] contains assist for GLSL, however omits most of the different options initially proposed which had been deferred to later variations of OpenGL (though many at the moment are obtainable as extensions).

OpenGL 2.1[edit]

OpenGL 2.1 was launched on August 2, 2006 and is backward appropriate with all prior OpenGL variations. OpenGL 2.1 incorporates the next performance:

  • OpenGL Shading Language revision 1.20
  • Instructions to specify and question non-square matrix uniforms to be used with the OpenGL Shading Language
  • Pixel buffer objects for environment friendly picture transfers to and from buffer objects for instructions akin to glTexImage2D and glReadPixels.
    This performance corresponds to the ARB_pixel_buffer_object extension.
  • sRGB texture codecs.
    This performance corresponds to the EXT_texture_sRGB extension.

OpenGL assist libraries[edit]

  • GLUT – The OpenGL utility toolkit.
  • GLU – Some further features for OpenGL applications.
  • GLEW – The OpenGL Extension Wrangler Library.


  1. “OpenGL ARB to Move Management of OpenGL Specification to Khronos Group”. Press Releases. Khronos Group. July 31, 2006. Retrieved 2006-08-01. 


Qt is a cross-platform software improvement framework, extensively used for the event of graphical consumer interface applications, and, because the launch of Qt 4, additionally used for growing non-GUI applications akin to console instruments and servers. Qt is most notably utilized in KDE, Qtopia and OPIE. It’s produced by the Norwegian firm Trolltech, previously Quasar Applied sciences and was later purchased by Nokia. Trolltech insiders pronounce Qt as “cute”.

The Qt designer used for GUI designing

Qt makes use of normal C++, however extends the language by offering an extra pre-processor that converts Qt’s extensions into pure C++.
Qt can be utilized by programmers utilizing different languages; bindings exist for Python (PyQt), Ruby, PHP, C, Perl, Pascal, and Java (Jambi). It runs on all main platforms, and has intensive internationalization assist. Non-GUI options embrace SQL database entry, XML parsing, thread administration, and a unified cross-platform API for file dealing with.


Qt is launched by Trolltech on the next platforms:

  • Qt/X11 — Qt for X Window System
  • Qt/Mac — Qt for Apple MacOS X
  • Qt/Home windows — Qt for Microsoft Home windows
  • Qt/Embedded — Qt for embedded platforms (PDA, Smartphone, …)
  • Qt/Jambi — Qt for Java platform Improvement.

There are 4 editions of Qt obtainable on every of those platforms, particularly:

  • Qt Console — version for non-GUI improvement.
  • Qt Desktop Mild — entry degree GUI version, stripped of community and database assist.
  • Qt Desktop — full version.
  • Qt Open Supply Version — full version for open supply builders.

The primary three editions are launched below a industrial license which allows closed supply improvement; whereas the Open Supply version is obtainable below the GPL license, and the LGPL (beginning with model 4.5) and moreover below the Q Public License (QPL) for the Qt/X11 model.

In case of the X11 platform, the QPL permits the ultimate software to be licensed below numerous open supply licenses, such because the LGPL or the Inventive license. For the Home windows and Mac OS X platforms, the GPL is the one Open Supply license obtainable so the purposes developed with it should be GPL as properly.

All editions assist a variety of compilers, together with the GCC C++ compiler. Official assist for the Visible Studio suite is, nonetheless, restricted to the industrial Qt/Home windows version. The Q../Free challenge has launched a number of patches which add assist for Microsoft Visible Studio and Borland C++ Builder to the open-source model of Qt/Home windows.


Trolltech launched Qt Four on June 28, 2005 and launched 5 new applied sciences within the framework:

  • Tulip A set of template container lessons.
  • Interview A mannequin/view structure for merchandise views.
  • Arthur A 2D portray framework.
  • Scribe A Unicode textual content renderer with a public API for performing low-level textual content structure.
  • MainWindow A contemporary action-based primary window, toolbar, menu, and docking structure.

Qt Four is dual-licensed below GPL and proprietary licenses on all supported platforms together with Home windows (whereas Qt/Home windows 3.Three is barely launched below a proprietary license).

Qt 4.1, launched on December 19, 2005, launched built-in SVG Tiny assist, a PDF backend to Qt’s printing system, and some different options.

Qt 4.2, launched on October 4, 2006, launched native CSS assist for widget styling, in addition to the QGraphicsView framework for environment friendly rendering of 1000’s of 2D objects onscreen, to interchange Qt 3.x’s QCanvas class.

Historical past[edit]

Haavard Nord and Eirik Chambe-Eng (the unique builders of Qt and the CEO and President of Trolltech respectively) started improvement of “Qt” in 1991, three years earlier than the corporate was included as Quasar Applied sciences, then modified the identify to Troll Tech, after which to Trolltech.

The toolkit was known as Qt as a result of the letter Q regarded lovely in Haavard’s Emacs font, and T was impressed by Xt, the X toolkit.

Controversy erupted round 1998 when it grew to become clear that KDE was going to turn out to be one of many main desktop environments for GNU/Linux. As KDE was primarily based on Qt, many individuals within the open supply and free software program actions had been nervous that an important piece of considered one of their main working methods can be proprietary.

This gave rise to 2 efforts: the Concord toolkit which sought to duplicate the Qt Toolkit below a free software program license and the GNOME desktop that was meant to supplant KDE totally. The GNOME Desktop makes use of the GTK+ toolkit which was written for the GIMP, and primarily makes use of the C programming language.

Till model 1.45, supply code for Qt was launched below the FreeQt license — which was considered as not compliant to the open supply precept by the Open Supply Initiative and Free Software program Basis as a result of whereas the supply was obtainable it didn’t permit the redistribution of modified variations. With the discharge of model 2.Zero of the toolkit, the license was modified to the QPL, a free software program license however one regarded by the Free Software program Basis as incompatible with the GPL. Compromises had been sought between KDE and Trolltech whereby Qt wouldn’t be capable of fall below a extra restrictive license than the QPL, even when Trolltech was purchased out or went bankrupt. This led to the creation of the KDE Free Qt basis, which ensures that Qt would fall below a BSD license ought to no open supply model of Qt be launched throughout 12 months.

The primary variations of Qt had solely two flavors: Qt/X11 for Unix and Qt/Home windows for the Home windows platform. The Home windows platform was solely obtainable below the industrial license. In the long run of 2001, Trolltech launched Qt 3.Zero which added assist for the Mac OS X platform. The Mac OS X assist was obtainable solely within the industrial license, till June 2003, the place Trolltech launched the model 3.2 with Mac OS X assist obtainable below the GPL license.

In 2002 members of the KDE on Cygwin challenge started porting the GPL licensed Qt/X11 code base to Home windows. This was in response to Trolltech’s refusal to license Qt/Home windows below the GPL on the grounds that Home windows was not an open-source platform. The challenge achieved cheap success though it by no means reached manufacturing high quality. Qt/Home windows Four was launched below the GPL by Trolltech in June 2005. Qt4 now helps the identical set of platforms within the Open Supply editions as within the industrial version.


The innovation of Qt when it was first launched relied on a number of key ideas.

Full abstraction of the GUI[edit]

Qt makes use of its personal paint engine and controls. This makes the work of porting to different platforms simpler as a result of only a few lessons in Qt depended actually on the goal platform. Qt used to emulate the native look of its meant platforms, which sometimes led to slight discrepancies the place that emulation wasn’t good. This, nonetheless, now not applies as a result of the most recent variations of Qt use the native kinds API of the totally different platforms to attract the Qt controls.

Meta Object Compiler[edit]

Often known as the moc, this can be a device that one should run on the sources of a Qt program previous to compiling it. The device will generate “Meta
Info” in regards to the lessons utilized in this system. This meta info is utilized by Qt to supply programming options not obtainable in C++:
introspection and the alerts and slots|sign/slot system.

The usage of an extra device has been criticised by a part of the C++ group, stating that Qt programming is making a mockery of C++. Specifically, the selection of an implementation primarily based on macros has been criticized for its absence of kind security. Some individuals confused the macros with new C++ key phrases, and criticized the air pollution of the namespace. That is considered by Trolltech as a vital trade-off to supply introspection and dynamically generated slots or alerts. Additional, when Qt 1.x was launched, consistency between compiler template implementations couldn’t be relied upon.

The usage of moc permits for a really versatile sign/slot messaging system, in order that a number of alerts can connect with a number of slots, to different alerts, or to slots on totally different threads, in a “callback protected” method.


  • Mandel is an interactive, multiplatform and multilingual program by Wolf Jung for drawing the Mandelbrot set and Julia units, and for illustrating and researching their mathematical properties. It is graphical consumer interface is predicated on Qt. It’s obtainable on Linux, Unix, Home windows, and Mac. The supply code is obtainable below the GNU Normal Public License.



The GIMP Toolkit (abbreviated as GTK+) is a free and open supply widget toolkit for creating graphical consumer interfaces that was initially created in 1998 for the GIMP, a raster graphics editor, by Spencer Kimball, Peter Mattis, and Josh MacDonald — all of whom had been members of eXperimental Computing Facility (XCF) at Berkeley College. GTK+ is licensed below the LGPL.

In contrast to many different widget toolkits, GTK+ is not primarily based on Xt. The benefit of that is that it permits GTK+ to be obtainable on different methods and to be far more versatile. GTK+ permits the end-user to configure the look of the toolkit, right down to providing a lot of totally different show engines. Engines exist which emulate the look of different widespread toolkits or platforms, like Home windows 95, Motif, Qt or NextStep. The drawback is that it does not have entry to the X useful resource database, which is the normal approach for customizing X11 purposes.

GTK+ 2 contains improved textual content rendering utilizing Pango, a brand new theme engine, improved accessibility utilizing Accessibility Toolkit, full transition to Unicode utilizing UTF-Eight strings and a extra versatile API. Nonetheless, GTK+ 2 lacks compatibility with GTK+ 1, and programmers should port purposes to it. Beginning with model 2.Eight GTK+ depends on the Cairo library for rendering of vector graphics.

Programming languages[edit]

GTK+ makes use of the C programming language, though its designers use an object-oriented paradigm. The GNOME platform bindings present for C++ (gtkmm), Perl, Ruby, Java and Python (PyGTK) bindings; others have written bindings for a lot of different programming languages (together with Ada, D, Haskell, Lua, Pascal, PHP, Pike and all .NET programming languages).

Environments that use GTK+[edit]

Screenshot of the GIMP 2.2 on a typical system
  • The GNOME surroundings makes use of GTK+ as a base, which signifies that applications written for GNOME use GTK+ as their toolkit.
  • Xfce additionally makes use of it as its base, although its apps sometimes don’t rely on as many applications. (That is the distinction between one thing being branded as a “GNOME program” and as a “GTK+ program”.)
  • The GPE Palmtop Surroundings, Maemo (Nokia’s Web-tablet framework), and Entry Linux Platform (a brand new Palm OS-compatible Private digital PDA platform) additionally use GTK+ as a base.

These desktop environments will not be required to run GTK+ applications, although. If the libraries this system requires are put in, a GTK+ program can run on high of different X11-based environments akin to KDE or an X11-plus-window supervisor surroundings; this contains MacOS X if is put in. GTK+ may run below Microsoft Home windows. Among the extra uncommon ports embrace DirectFB and ncurses.


Additional studying[edit]

  • Richard S. Wright Jr. and Benjamin Lipchak: OpenGL Superbible, Third Version, Sams Publishing, 2005, ISBN 0-672-32601-9
  • Astle, Dave and Hawkins, Kevin: Starting OpenGL Recreation Programming, Course Know-how PTR, ISBN 1-59200-369-9
  • Fosner, Ron: OpenGL Programming for Home windows 95 and Home windows NT, Addison Wesley, ISBN 0-201-40709-4
  • Kilgard, Mark: OpenGL for the X Window System, Addison-Wesley, ISBN 0-201-48359-9
  • Lengyel, Eric: The OpenGL Extensions Information, Charles River Media, ISBN 1-58450-294-0
  • OpenGL Structure Overview Board, et al: OpenGL Reference Guide: The Official Reference Doc to OpenGL, Model 1.4, Addison-Wesley, ISBN 0-321-17383-X
  • OpenGL Structure Overview Board, et al: OpenGL Programming Information: The Official Information to Studying OpenGL, Model 2, Fifth Version, Addison-Wesley, ISBN 0-321-33573-2
  • Rost, Randi J.: OpenGL Shading Language, Addison-Wesley, ISBN 0-321-19789-5

Related posts

Leave a Comment