Sign in to follow this  
Steve_M

ReallySlick OpenGL ScreenSavers

Recommended Posts

Hi to all, I'm new to this forum and I'm also new to programming in C/C++. I have recently installed Dev-CPP and downloaded/compiled/built/run all of the NeHe lessons. I would just like to say a big thank you for the excellent articles, I have learnt a great deal in a very short time frame. Seeing the 3D graphics in action in OpenGL inspired me to want to write my own program. I decided that the NeHe code was a good starting point for producing a screensaver using OpenGL graphics. With this in mind I searched the Internet for guidance on writing screensavers and came across a couple of useful articles. I also came across the ReallySlick screensavers website (www.reallyslick.com). The OpenGL screensavers at ReallySlick were produced by Terry Welsh and they are absolutely brilliant. The site allows you to download the C++ source code, which I have done, and I have compiled/built successfully 9 out of the 10 applications available. The last, and best of the bunch (Skyrocket), is causing me some problems. I am able to compile and build the sourcecode but the program will not run and exits immediately with a SIGSEGV error message. It's a real struggle trying to debug screensaver programs and this particular error message is also a nightmare to resolve. I guess I'm posting these details in the hope that someone else may also download the sourcecode and perhaps correspond with me to get a solution and solve the problem. I have already written to Terry himself, and this problem has never been raised with him before, and he has no solution. Terry has used Visual Studio 7.1 to build the software. I don't know if that point is relevant. The Skyrocket screensaver also incorporates OpenAL sound, another new area for me, I had to download and install the library/headers for this part of the development process. The Skyrocket application contains a lot of data for texturing in OpenGL and for sound in OpenAL, I suspect that this data is overwriting the application in memory and causing the SIGSEGV crash. These screensavers are really impressive and I believe the sourcecode provides a great resource for those wishing to learn how to produce incredibly impressive 3D animation and graphics in OpenGL. Regards, Steve

Share this post


Link to post
Share on other sites
As a follow up to my initial post, and for anyone that decides to download the source code for these OpenGL screensavers, I have managed to find the bug in the source code of Skyrocket that causes the SIGSEGV error (memory segmentation error).

World.cpp module, line number 51, unsigned char starmap[STARTEXSIZE][STARTEXSIZE][3];

This variable declaration needs to be removed and placed in the World class prototype public declarations along with the other class variables found in the World.h header file. Dev-CPP compiled and built the application without complaint, with this bug in the code, but the structure was obviously overwriting sections of the program in memory. STARTEXSIZE is set to 1024, so this is a fairly large structure that gets initialized to contain zero's in the next few lines. The application obviously crashed once it came across a zero instead of a valid memory address.

Regards, Steve

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this