Have you looked at the OpenGL SuperBible? I've skimmed through it and it seems neat if your interested in learning everything there is to know about OpenGL. I found it at Chapters but I'm sure many bookstores have it.
On a side note, I've been writing a program that takes an inputted number and determines if it is a prime or composite number. I've done many revisions and this is what I have so far:
Code: Select all
#include <iostream>
int main()
{
using namespace std;
int input, oneortwo = 0, test, ans = 0, i = 2;
cout << "Enter a number to be checked as a prime or composite number\n";
cin >> input;
if (input == 1 || input == 2)
{
ans = 1;
oneortwo = 1;
}
while (i != input)
{
if (oneortwo == 1)
break;
test = (input%i);
cout << "Test: " << test << "\t\ti: " << i << endl;
i++;
if (test == 0)
{
ans = 0;
break;
}
else
{
ans = 1;
}
}
if (ans == 0)
{
cout << endl << input << " is a Composite Number\n";
}
else
{
cout << endl << input << " is a Prime Number\n";
}
cout << "\nPress ENTER to quit\n";
cin.get();
cin.get();
return 0;
}
This line:
Code: Select all
cout << "Test: " << test << "\t\ti: " << i << endl;
is just for debugging but will write quite a bit on screen but it will end and not just keep going. If anyone finds any bugs or numbers that are misinterpreted then please let me know. You need a C++ compiler and although I would upload the program itself, you can't upload .exe files so your going to need a compiler.