static void display()
{static int n;
    glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
    glLoadIdentity();
	static glShaderManager SM;
static glShader *shader;
if(!n)
{
shader=	SM.loadfromFile("vert2.txt","frag2.txt");

}

static	 timer t;
double t2=t.elapsed();
	glPointSize(23);
static	vector< particule> v;



	Repere();
	if(!n)
	{
	for(int i=0;i<2000;i++)
	{
		v.push_back(particule(45,20,8,1,i));
	}
}
	
	
	
	shader->begin();
	

int c=v.size();

	for(int i=0;i<c;i++)
	{
		

	shader->setUniform1f("p.alpha",v[i].getAlpha(),shader->GetUniformLocation("p.alpha"));
	shader->setUniform1f("p.beta",v[i].getBeta(),shader->GetUniformLocation("p.beta"));
	shader->setUniform1f("p.vIn",v[i].getInitV(),shader->GetUniformLocation("p.vIn"));
	shader->setUniform1f("p.t",t2/2,shader->GetUniformLocation("p.t"));
	shader->setUniform1f("p.start",v[i].getStart(),shader->GetUniformLocation("p.start"));
	shader->setUniform1f("p.life",v[i].getLife(),shader->GetUniformLocation("p.life"));


	v[i].draw(0,0,0);
	}


	shader->end();
	n++;
	
	if(n>2)
		n=1;

glutSwapBuffers();

}
    std::future<bool> send(core::const_frame frame) override
    {
        CASPAR_VERIFY(format_desc_.height * format_desc_.width * 4 == frame.image_data(0).size());

        graph_->set_value("tick-time", tick_timer_.elapsed() * format_desc_.fps * 0.5);
        tick_timer_.restart();

        caspar::timer frame_timer;

        {
            auto audio_buffer = core::audio_32_to_16(frame.audio_data());
            airsend::add_audio(air_send_.get(),
                               audio_buffer.data(),
                               static_cast<int>(audio_buffer.size()) / format_desc_.audio_channels);
        }

        {
            connected_ = airsend::add_frame_bgra(air_send_.get(), frame.image_data(0).begin());
        }

        graph_->set_text(print());
        graph_->set_value("frame-time", frame_timer.elapsed() * format_desc_.fps * 0.5);

        return make_ready_future(true);
    }
Example #3
0
File: run.hpp Project: vtnerd/prima
            results measure(const Implementation& implementation) const
            {
                // Run a few times in an attempt to pull code pages into CPU
                // cache
                execute(implementation);
                execute(implementation);

                timer::duration elapsed{0};
                unsigned result{0};
                {
                    const timer time;
                    result = execute(implementation);
                    elapsed = time.elapsed();
                }
                return {elapsed, result};
            }
// For the vector and list class, use the STL algorithm lower bound.
// For the set and unordered set class, use the container’s method find.


class timer {
public:
    timer() : start(clock()) {}
    double elapsed() { return ( clock() - start ) / CLOCKS_PER_SEC; }
    void reset() { start = clock(); }
private:
    double start;
};


timer t;
double duration = t.elapsed();

string testWord = "luge";

// look up lower bound algorithms
// look up how to do a find within sets andunordered sets.
// also double check whether you can make open the ENABLE file!!!

int main(){
    
//    cout << "//======================================= PART TWO =======================================//" << endl;
//    
//    vector<Student> compVec{Student("Lisa"),Student("Jessica"), Student("Marie"), Student("Apple")};
//    
//    meFirst myComp("Monty") ;
//    
Example #5
0
File: time.hpp Project: noma/ham
	// add a timer
	void add(timer const& t) { add(t.elapsed()); }