🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

ReallySlick OpenGL ScreenSavers

Started by
0 comments, last by Steve_M 17 years, 2 months ago
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
Advertisement
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

This topic is closed to new replies.

Advertisement