Exemplo n.º 1
0
int main(int argc, char **argv)
{

    //Chache testing
    /*
    try{
        util::Cache test( "test" );
        test.write("hello", 1.010102, 0, false, util::Cache::FLAG_FLOAT);
    } catch ( util::Exception e ) {
        e.log();
        dbgconsole << "Chache exception has occured...\n";
    }
    */

    //Linked list testing
    /*
    dbgconsole << "Constructing list\n";
    util::SLinkedList<int> list;
    dbgconsole << "list constructing, inserting 1\n";
    list.insert(1);
    dbgconsole << "Inserted\n";
    list.insert(2);
    list.insert(3);

    list.debug_output();
    */

    sf::Window window(sf::VideoMode(800, 600), "Magnet", sf::Style::Titlebar, sf::ContextSettings(24, 0, 4)); //sf::WindowSettings(24, 8, 4)
    sf::Thread ResourceLoader(&load_resources); //&Resource::Load

    //This is now useless
    size_t _serial_entity_size = 5000;

    while(window.isOpen()){
        if(Magnet::IsInitialized()){
            EventHandler::Listen(window);
            Magnet::Think();
        }else{
            try{
                Magnet::Init(_serial_entity_size, window, ResourceLoader);
            }

            catch(util::Exception e){
                std::cout << "ABORT MAGNET INITIALIZATION\n";
                return -1;
            }
        }
    }


    return 0;
}
Exemplo n.º 2
0
/*static*/
std::vector<Vector3>
EngineHelper::LoadDravenVerts(){
	vector<glm::vec3> out_vertices = vector<glm::vec3>(); 
	vector<glm::vec2> out_uvs = vector<glm::vec2>(); 
	vector<glm::vec3> out_normals = vector<glm::vec3>(); 

	vector<Vector3> ret = vector<Vector3>(); 

	ResourceLoader loader =  ResourceLoader();
	vector<Vector3> manequinVerts = vector<Vector3>(); 
	loader.LoadMeshOBJ("D:/Tools/Development/Dropbox/Workspaces/WorkspaceCpp/Kevlar3D/K3Res/cube.obj",out_vertices,out_uvs,out_normals);

	int meshSize = out_vertices.size();
	for (int i=0;i<meshSize;i++){
		ret.push_back(Vector3(out_vertices.at(i)));
	}
		
	return ret;
}
Exemplo n.º 3
0
ResourceLoader getNewLoader(){
	return ResourceLoader(nextId());
}
Exemplo n.º 4
0
ResourceLoader getLoader(u32 id){
	return ResourceLoader(id);
}