+
+
#include "Global.h"
#include "gl_et_al.h";
#include "jttoolkit.h";
Global *Global::instance;
-Global::Global(){
- srand(982);
+Global::Global()
+{
+ srand(982);
- instance=this;
+ instance = this;
- hideMouse();
+ for(int i=0;i<20000;i++){
+ rnd.push_back(randomFloat());
+ }
- // toggleFullScreen();
+ glEnable(GL_LINE_SMOOTH);
+ glEnable(GL_POINT_SMOOTH);
+ glHint(GL_LINE_SMOOTH_HINT,GL_NICEST);
- // random number array
- for(int i=0;i<20000;i++){
- rnd.push_back(randomFloat());
- }
+ for(int i=0;i<10000;i++){
+ thingies.push_back(new Thingy());
+ thingies.back()->z = ((rnd[i+7] - .5) * 100000000);
+ }
- glEnable(GL_LINE_SMOOTH);
- glEnable(GL_POINT_SMOOTH);
- glHint(GL_LINE_SMOOTH_HINT,GL_NICEST);
-
- for(int i=0;i<10000;i++){
- thingies.push_back(new Thingy());
- thingies.back()->z = ((rnd[i+7]-.5)*1000000);
- }
+ hideMouse();
+
+ INC = 550;
+
+ toggleFullScreen();
}
-
-Global::~Global(){
+Global::~Global()
+{
}
-void Global::loop(){
- vector<Thingy*>::iterator it;
-
-
- int cnt=0;
- /*
- for(it=thingies.begin();it!=thingies.end();it++){
-
- (*it)->step();
- (*it)->draw();
- (*it)->x = rnd[cnt] * width();
- (*it)->y = rnd[cnt] * height();
- (*it)->z = 0; //(rnd[cnt]-.5)*1000; // ( ((rnd[cnt]-.5)*10) + ( (mouseX()-(width()/2)) * .085 ) );
- //(*it)->dest.z = (rnd[cnt]-.5)*1000; //( ((rnd[cnt]-.5)*10) + ( (mouseX()-(width()/2) ) * .085 ) );
- cnt++;
-}
-*/
-
- for(int i=0; i<thingies.size(); i++){
-
- thingies[i]->x = rnd[i]*width();
- thingies[i]->y = rnd[i+3]*height();
-
-
- thingies[i]->z += ((mouseX()-(width()/2))*.04);
-
- thingies[i]->step();
- thingies[i]->draw();
- }
-
-
-
- glColor4f(1,1,1, 0.1);
- glBegin(GL_LINE_STRIP);
- for(it=thingies.begin();it!=thingies.end();it++){
- (*it)->glVertex();
- }
- glEnd();
-
-
-
- glColor4f(1,1,1, 1);
- glBegin(GL_POINTS);
- for(it=thingies.begin();it!=thingies.end();it++){
- (*it)->glVertex();
- }
- glEnd();
-
-
-
-
+void Global::loop()
+{
+ vector<Thingy*>::iterator it;
+
+ INC += (704 - INC) * 0.001;
+
+ int cnt = 0;
+ for(int i=0; i<thingies.size(); i++)
+ {
+ thingies[i]->x = rnd[i] * width();
+ thingies[i]->y = rnd[i+3] * height();
+
+ // position
+ thingies[i]->z += ((INC - (width() / 2 )) * .04);
+
+ thingies[i]->step();
+ thingies[i]->draw();
+ }
+
+ glColor4f(1, 1, 1, 0.1);
+ glBegin(GL_LINE_STRIP);
+ for(it = thingies.begin(); it != thingies.end(); it++) {
+ (*it)->glVertex();
+ }
+ glEnd();
+
+ glColor4f(1, 1, 1, 1);
+ glBegin(GL_POINTS);
+ for(it = thingies.begin(); it!= thingies.end(); it++){
+ (*it)->glVertex();
+ }
+ glEnd();
}
-void Global::keyDown(int k,int special){
- char s[256];
- sprintf(s, "god.%04i.png", ticks());
- cout << s << endl;
- saveScreen(s);
-
+void Global::keyDown(int k, int special)
+{
+// char s[256];
+// sprintf(s, "god.%04i.png", ticks());
+// cout << s << endl;
+// saveScreen(s);
}
-void Global::mouseDown(){
- rnd.clear();
- for(int i=0;i<1000;i++){
- rnd.push_back(randomFloat());
- }
- vector<Thingy*>::iterator it;
-
- int cnt = 0;
- for(it=thingies.begin();it!=thingies.end();it++){
- (*it)->resetRandoms();
- (*it)->z = ((rnd[cnt+7]-.5)*9000000);
- cnt++;
- }
-
+void Global::mouseDown()
+{
+ /*
+ rnd.clear();
+ for(int i=0;i<1000;i++){
+ rnd.push_back(randomFloat());
+ }
+ vector<Thingy*>::iterator it;
+
+ int cnt = 0;
+ for(it=thingies.begin();it!=thingies.end();it++)
+ {
+ (*it)->resetRandoms();
+ (*it)->z = ((rnd[cnt+7] - .5) * 9000000);
+ cnt++;
+ }*/
+ cout << INC << endl;
}
-void Global::mouseUp(){
+
+
+void Global::mouseUp()
+{
}
+