OpenGL Programming on Linux
The days went by, and we started incorporating more and more code into the project. My team-members had more course work than I did, so I found myself leading the team—writing most of the code in the first part of the project and all of it in the second and third parts. Of course, I was writing it all on Linux—but always verifying later that it ran on the RS/6000 workstations (Murphy, you know?).
Of course, that did not go unnoticed, and some of the students in the class started exploring ways to build and develop their own projects at home on their PCs using NT or that OS-with-an-expiration-date-in-its-name (Windows 95). Others followed my advice that it would probably be better to use a Unix because of portability problems (I thought...er envisioned...er imagined that the Win32 API could be quite different from that of most Unices) and got Mesa running. After all, if you have the choice and if you can do the same things you do at your university at home, would you rather spend nights in a freezing-cold computer lab with armless wooden chairs or work on your home computer?
Problems started to appear just a few weeks after that when we were required to implement and use a timer within the game. That was the first blow for the NT/95 people because, unless you're familiar with the Windows API or have some sample source code, changing Unix's gettimeofday() to a Windows API call is not trivial. After all, if your virtual tank is going at 10 m/s, it should do so no matter what hardware you have, be it a 16 CPU SGI workstation or a poor 80486. Some people got tired of putting #ifdefs and #ifndefs in their code and decided to spend nights in the lab instead.
Then came the network daemon. The idea (mostly at my suggestion) was that the game client running on a particular workstation would fork() a daemon at initialization. The daemon would share one or more memory segments with the client and would have the task of listening on certain ports for broadcast messages sent by other possible network players. Needless to say, these Unix intrinsics marked the end of the Windows port; even if you could run a part of the 3D engine on Win32, you'd still have to do all the network and final debugging on the RS/6000 workstations at school.
But during all this time there was at least one happy Linux user who did not change a single line of code when sending it from his home Linux box to the Risc workstations. And the only time he actually had to put an #ifdef was when the endianness difference between the Pentium and the RS/6000 processor started to show in the byte ordering of the TARGA files he was loading and using for textures. Rumour even has it that he debugged his network code without actually entering the computer lab: in the darkest hours of the night he used two workstations to run his program on and exported the display to his Linux box (which was slow, but functional enough to track down some bugs).
Speaking about performance in OpenGL is, for those of us who don't use a middle to high-end SGI workstation at home or at work, about as important as speaking about OpenGL itself. In our case, around the middle of the semester, it became obvious to both professors and students alike that the RS/6000 workstations we were using were not fast enough for what we were doing with them.
Eventually we switched to another lab of RS/6000 workstations which belonged to the Mechanical Engineering Department. People there ran CATIA—like AutoCad but with ten times the features and the memory requirements. Those workstations were still not inherently faster than a good Linux Pentium PC with enough RAM; most tests, gcc, xv, etc, showed my P133 was about 50-60% faster doing generic operations. But their hardware-accelerated OpenGL graphics allowed my game to run on them at 25 frames per second with 512x384 pixels. By comparison, I was getting a maximum of only 9-10 frames per second with 320x240 pixels on my Linux box, where OpenGL rendering was done by software alone on the main CPU and FPU.
The program still ran, and it was fast enough to allow me to work out most of the bugs and implement new features, but I would personally have enjoyed it a lot more if the Linux OpenGL port I was using had been able to take advantage of the 3D features on my video card to make my programs run even faster. On my end, I tried removing as much un-optimized stuff as possible from the game's main loop to make it run as fast as possible on all platforms.
Here are some stats about the project:
Lines of code: about 7600 (game and daemon) + 900 (explosions renderer)
Number of textures and ray-traced rendered explosions: 34
Number of different object lists used: 38
Number of possible network players or automated opponents: 20
Features only available on Linux: basic sound!
Time spent pulling our hair out on that game: around 200-250 man-hours
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- A Topic for Discussion - Open Source Feature-Richness?
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Validate an E-Mail Address with PHP, the Right Way
- RSS Feeds
- Tech Tip: Really Simple HTTP Server with Python
- Readers' Choice Awards
- BASH script to log IPs on public web server
24 min 26 sec ago - DynDNS
4 hours 14 sec ago - Reply to comment | Linux Journal
4 hours 32 min ago - All the articles you talked
6 hours 56 min ago - All the articles you talked
6 hours 59 min ago - All the articles you talked
7 hours 40 sec ago - myip
11 hours 25 min ago - Keeping track of IP address
13 hours 16 min ago - Roll your own dynamic dns
18 hours 29 min ago - Please correct the URL for Salt Stack's web site
21 hours 41 min ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




Comments
Linux remote
Any idea how to remote PCs running any type of OS with good quality graphics?
hello, here is a link
http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/ogladv/index
Hello. I'm learning
Hello. I'm learning OpenGL/SDL. i recommend 4 u NeHe!
Question about Linux/OpenGL
Hey man! I really enjoyed your story. I'm in CETYS Universidad (in Mexico) studying Electronics Engineering. I work developing software in OpenGL using MFC, I want to start programming in C/C++ under Linux and use OpenGL, what links can you recommend me??? I'm totally new to Linux, I installed Fedora 9 a month ago, so I'm not really familiar with the environment, what can I do to learn? any advice will be highly appreciated!