Redbook redux

I grabbed redbook opengl samples again, probably the tenth time. I wanted to run through them again. I do this with everything I learn. Each pass through gives me just a little more comprehension. Since I have learned matrices so well with the MIT course and had some more experience, I decided to revisit on the occasion of making a sphere from triangle in a sensible way with speed, texture, lighting, and smoothness considered. I can just select sphere from the menu in blender and have one with a couple clicks, but I want to do something different with the objects that includes field variable vector orientation and intensity indications across an entire volume of space.

I scripted the shell code below to allow me to run through the samples quickly and see what I wanted to investigate further. There is latency in the creation of the file and the time it can be executed and so I did two passes. I also wanted to see what Wall, ansi and pedantic had to say about the code. Strangely there is an unused x and y variable in every source. I suppose that is some remnant of a change in window placement that was deprecated in Xwindows in the past. It does still work, but the system remembers where windows are last placed and over-rides the values, is the concern, I am just guessing. There were a few warns that I wanted to check out and so I will probably clean the redbook samples I have so they have no ansi warns and keep them for future reference.

for i in *.c do x=`echo "$i"|sed s/[.]c//` echo "$x" "$i" gcc -Wall -W -ansi -pedantic "$i" -lGL -lglut -o "$x" if [ $? == 0 ] then echo "$x" "compiled okay" else echo "$x" "FAILED to compile correctly." fi done for i in *.c do x=`echo "$i"|sed s/[.]c//` echo "$x" "$i" gcc -Wall -W -ansi -pedantic "$i" -lGL -lglut -o "$x" if [ $? == 0 ] then echo "$x" `./"$x"` fi done

This is what cause the warn and it is inescapable if using the glut mechanism, so I am going to ignore that.

glutKeyboardFunc (keyboard); void keyboard(unsigned char key, int x, int y)

This is the other thing that is bothering me and I can't continue until all bugs are removed, or I know why they exist, so they don't crawl around behind me and bite me in the .uhm.... heel. I am sure the code is okay, but I will find out why that happens and learn something new about XWindows that may be useful in the future.

aaindex freeglut (./aaindex): ERROR: Internal error in function fgOpenWindow X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 4 (X_DestroyWindow) Resource id in failed request: 0x0 Serial number of failed request: 25 Current serial number in output stream: 25

Just so somebody else knows, this is the change I made to fix that XWindows err.

glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_ALPHA | GLUT_DEPTH);

0 comments:

Contributors

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen