Click here to Skip to main content
15,897,519 members
Articles / Desktop Programming / MFC

Writing a Platform and GUI Toolkit Independent OpenGL Class

Rate me:
Please Sign up or sign in to vote.
4.92/5 (33 votes)
1 Nov 2010CPOL13 min read 98.5K   7.5K   90  
Article showing how to write OS and GUI toolkit portable OpenGL view class
Requires autotools installed
Note: convenience scripts to build and run the samples are provided.
In case you want to perform the build and then run the samples individually on your own, use the procedure given below.

1) Build the GLView library first. For things to work hasslefree use the following procedure.
	Using the commands below...
	> cd GLView
	> autoreconf --install
	> ./configure --prefix=$PWD/../
	> make install
	...creates a directory named include and lib in the toplevel directory and installs the GLView.h in the include directory and libGLView.so and its links in the lib directory.

2) Set the LD_LIBRARY_PATH variable to point to the lib directory.
	e.g. Let us say the toplevel directory is /home/yourname/MultiGL
	The lib dirctory is MultiGL/lib
	in this case, in bash...
	export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/yourname/MultiGL/lib
	in tcsh...
	setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/yourname/MultiGL/lib

	

3) Build the examples that you would like to see.
	For Gtk example, GTK+ devel packages should be installed.
	Using the commands below... (applicable for Motif example too)
	cd GLViewGTKApp
	autoreconf --install
	./configure --prefix=$PWD/../
	make install
	...creates a folder named bin in the toplevel directory and installs the executable in it.

	For Qt example you can either use QtCreator or use qmake-qt4 to generate the makefile and use it from command line. The executable is installed in the top level bin directora as the other examples.

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Product Manager Mahindra & Mahindra
India India
Sharjith is a Mechanical Engineer with strong passion for Automobiles, Aircrafts and Software development.

Comments and Discussions