LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-08-2005, 04:07 PM   #1
TotalLinuxNoob
Member
 
Registered: Apr 2005
Distribution: Ubuntu
Posts: 109

Rep: Reputation: 15
C++ beginner - libraries and graphical programming


I have recently started Uni in the UK [I think the Americans dubbed it College] and enrolled on a computer science course including a one year placement.
Overall the pace is fast enough for me but, as I have some previous programming experience, the C++ sessions seem to take the mickey. Spending a lecture and another hour in class on mainly for loops just isn't on.
Despite not being entirely new to programming [this is a good gauge on my skill level - source and binary of aTetris Game done in C# win32] I am new to C++ and have set myself the following tasks:

Creating a sort of plugin / extension system. Now, I queried my tutor on this but she has no idea. Similarly, I have no idea on where to start. I'm thinking of an approach similar to using DLL's - the program queries a folder for any DLL's and loads them so the program can be modified by third parties. The plugins themselves will be very simple but it is just to teach myself the basics of plugins on Linux.
So far the only thing I have come across is that Linux's DLL system has the extension .so

Writing Tetris like I have done in C# but in C++ which is to work under Gnome. I believe both kde and gnome offer different toolkits on graphical programming but I have gnome in mind as I use it personally. Anything more advanced on the topic and I am entirely untutored.
The way the C# version was approached was through using a graphics buffer in memory and drawing it to screen once the buffer was completely updated. I'm hoping for a similar approach using C++...
As it is to work under Gnome would using the GTK+ tookit be the best way to approach the problem or are there C++ libraries that take care of drawing directly to screen/ creating GUI's?

No previous experience with GTK or linux programming apart from some simple Python scripts.

An intermediary step will probably creating a program with UI first.

Any help links / tips / insights or approach tutoring appreciated.

Thanx all
 
Old 11-08-2005, 11:04 PM   #2
bendeco13
Member
 
Registered: Oct 2004
Distribution: Fedora 7
Posts: 232

Rep: Reputation: 30
I currently use GTK, its fairly easy to learn, well compared to all the others. I first used pygtk, but have recently been more focused on programming in C++. I've wrote a bunch of header files and I am still writing a bunch of them. I REALLY want to learn QT. If you haven't heard of it, it is Trolltech's toolkit. It is os independent, and it is free for personal usage, much like GTK. KDE uses QT, kindof like Gnome uses GTK. I have tried to learn QT, but is a little more difficult than GTK. With the new release of QT4 and all of its great performance enhancements, I see it growing very large in the linux world whenever KDE4 is actually released. I like to keep these things in mind, especially as a begginer. Basically if you have no prior knowledge of any of the toolkits, and you want a challenge, I would suggest trying QT. Other than that, I would use GTK. I don't know much about it, but you mentioned creating a few games, and openGL is supposively the best for programming 3d objects and so forth.

Here's some useful links:
http://www.gtk.org/tutorial/
http://doc.trolltech.com/3.0/
http://www.opengl.org/resources/tutorials/

Hope these suggestions help.
Bendeco

Last edited by bendeco13; 11-08-2005 at 11:08 PM.
 
Old 11-08-2005, 11:52 PM   #3
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,861
Blog Entries: 1

Rep: Reputation: Disabled
One option you might wish to consider is "Mono": an open-source implementation of .Net (and C#) for Linux.

The Mono project is founded by the guy who founded the Gnome Project: Miguel de Icaza. You can learn more here:

http://www.mono-project.com

Your .. PSM

PS:
I've used both Qt and GTK+ and, frankly, I have a strong preference for GTK+. For whatever it's worth. But heck - I have a strong preference for C over C++ (in fact, one of the things I like about GTK+ is that it lets me mix'n'match C and C++ in different parts of the program, and doesn't force me to strictly use C++ like Qt). It's just a matter of taste...
 
Old 11-09-2005, 05:09 AM   #4
TotalLinuxNoob
Member
 
Registered: Apr 2005
Distribution: Ubuntu
Posts: 109

Original Poster
Rep: Reputation: 15
Thanx guys.
The links turned out most useful. However, despite mentioning games such as Tetris, I'm not really into the 3d programming - just some basic 2d programming [like tetris blocks] to get to grips with the beginnings. 3D would be my thing had I been on a games development course. Really trying to create a graphics object is pretty much the main challenge.

I would like to get to grips with mono but the [comp sci] course teaches C++ so I'd rather stick to that.


1. If I would be using GTK/QT would it make the program unusable under either window manager or would that depend on whether the system has the required libs/resources installed? Effectively making it window manager independent.

2. Any tips on the DLL like approach? Personally I don't have a clue on where to start... an intro would suffice for now

3. The GTK tutorial mentions that "his is a tutorial on how to use GTK (the GIMP Toolkit) through its C interface." That does not stop me from using C++, right?


Last edited by TotalLinuxNoob; 11-09-2005 at 05:16 AM.
 
Old 11-09-2005, 08:38 PM   #5
bendeco13
Member
 
Registered: Oct 2004
Distribution: Fedora 7
Posts: 232

Rep: Reputation: 30
I currently use GTK through C++, so NO GTK does not limit you to C.

I'm not that knowledgable in the difference between C and C++, so these assumptions may be wrong, but I think that C++ can still use C syntacs, headers, ect.
So anything that can be used in C can be used in C++.

Last edited by bendeco13; 11-09-2005 at 08:43 PM.
 
Old 11-10-2005, 12:56 AM   #6
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,466

Rep: Reputation: Disabled
Quote:
Originally posted by TotalLinuxNoob
1. If I would be using GTK/QT would it make the program unusable under either window manager or would that depend on whether the system has the required libs/resources installed? Effectively making it window manager independent.
I don't think if used GTK, you couldn't run your program under KDE. I can definitely run KDE apps in GNOME and vice versa!

Where are you at uni btw?
 
Old 11-10-2005, 07:35 AM   #7
TotalLinuxNoob
Member
 
Registered: Apr 2005
Distribution: Ubuntu
Posts: 109

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Nylex
I don't think if used GTK, you couldn't run your program under KDE. I can definitely run KDE apps in GNOME and vice versa!

Where are you at uni btw?
Maybe that's b/c you have the QT libs installed or something?

I've just started at Teesside Uni. I went by it's reputation - it received excellent for it's school of computing apperantly but for the rest its performance seems mediocre. Entering Middlesbrough was quite a shock I can tell you!
I cannot really complain about the teaching or the facilities only the slow progress of the C++ module and tutor's apperant lack of linux programming knowledge tho this perception could of course always change.
I notice your location mentions Birmingham. I spent the last two years living there on my own on to do a BTEC Nat. Diploma software development course. It sucked beyond belief. The highest grade was awarded by default to pupils.

All I need now is to find out bout q2 and I'm done
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best beginner book for C programming? rmy1 Programming 21 01-18-2010 07:14 PM
graphical programming asahlot Programming 1 10-13-2005 09:07 AM
Beginner C programming projects/activities/games Opeth Programming 2 09-30-2004 11:06 AM
Programming beginner requirements, tools Shotz Programming 7 03-01-2004 04:52 PM
programming beginner darksvr Programming 6 09-11-2003 02:05 AM


All times are GMT -5. The time now is 03:39 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration