Jump to content

[SOLVED] Scheduler can it be used without the Game Framework


photo

Recommended Posts

The game framework is normal UNIGINE script code. Therefore you can easily extract the relevant code and convert it to a stand-alone version.

Link to comment

Hi Paul!

 

I've made a test sample with scheduler for you which you can find in the attachments. All you need to do is to include scheduler header and initialize it properly like in this code:

#include <core/unigine.h>
#include <framework/game/scheduler.h>

Game::Scheduler scheduler;

/*
 */
int init() {
	scheduler = new Game::Scheduler();
	scheduler.setPeriodicUpdate(NULL,"func",1,1);
	return 1;
}

/*
 */
int shutdown() {
	delete scheduler;
	return 1;
}

/*
 */
int update() {
	float ifps = engine.game.getIFps();
	
	scheduler.update(ifps);
	return 1;
}

/*
 */
int func() {
	log.message("Hi from scheduler!\n");
}

test_scheduler.zip

Link to comment
×
×
  • Create New...