Most of technical people are trying to migrate from windows to Linux now a days , but they are facing lot of problems with Linux . they do not even know the forums and blogs of Linux which would be useful for finding answer to their query. The main problem of open source is choosing right one for user need.
Because so many open source softwares are available for a single thing. Surely user need some supportive forum or website to find that one . open Peta is also doing that job. The idea of this post coming to my mind from my college friend . One of my colleague asked me about computer graphics program in Linux using C programming language. the questions isI was searching Internet and found some softwares for developing graphics applications in Linux. that softwares are listed here
- GTK+ – Gnome Tool Kit
- QT - The X toolkit
- SVGALIB [ #include<vgagl.h> ]
- libgraph [ #include<graphics.h> ]
GTK and QT are simple and used for high level Graphical User Interface [ GUI ] development. SVGALIB and libgraph is used for 2D graphics in Linux . the syntax and functions are some what different for beginners [specially the user from windows ] but most of users familiar with windows graphics.h header file in C and C++ , so we can move for libgraph which is exact one for windows graphics user . libgraph is an implementation of the Turbo C graphics API (graphics.h) on GNU/Linux using SDL [ Simple Direct Media Player ]. The library requires SDL for primitive graphics and SDL. First you need to install the following dependency packages using synaptic package manager in Ubuntu Linux to develop the graphics applications properly.
- SDL Library
Installing SDL Library
- GUILE – GNU’s Ubiquitous Intelligent Language for Extension
GUILE Installation
- After installing these two packages , download the libgraph and install in your system
For better understanding , watch this video given here ….
Developing Graphics Application
1. Open your favorite text editor and type the following code
2. Now compile the program with lgraph library
If you get any error in this line like
./output: error while loading shared libraries: libgraph.so.1: cannot open shared object file: No such file or directory
Do the following
3. Now one new window will open , there you will get the output Rectangle in Red color.
Output Window
The advantage of libgraph is very easy to remember the syntax [ all functions are same as turbo c graphics.h ] . still if you are facing any problem to develop graphics applications using this , send your problems through comment page of this post.
__________________________________________________________________________________
__________________________________________________________________________________
No comments:
Post a Comment