added RenderQueue

This commit is contained in:
cirdan
2008-01-17 16:42:24 +00:00
parent 8f17a3a819
commit 7a3d5f6eb5
17 changed files with 578 additions and 347 deletions

View File

@@ -87,6 +87,7 @@ int main(int argc, char **argv)
ref_ptr<RigidBodySimulation> simulation = new RigidBodySimulation(scriptsystem);
ref_ptr<ModelManager> modelmanager = new ModelManager (texturemanager, shadermanager, meshmanager);
ref_ptr<Camera> camera = new Camera();
ref_ptr<RenderQueue> queue = new RenderQueue();
/*
ShaderProgram prog =
@@ -130,15 +131,16 @@ int main(int argc, char **argv)
while (window->isOpen())
{
device->clear();
double time = glfwGetTime();
_DeltaTime = time - _LastTime;
_LastTime = time;
// device->setViewMatrix();
// device->setProjectionMatrix();
camera->setupProjectionMatrix();
camera->setupViewMatrix();
device->clear();
device->begin3D(camera);
queue->clear();
queue->addOpaqueItem(model, Vector3(10.0, 0.0, 0.0), Quaternion(Vector3(0.0,1.0,0.0), fmod(time, 3)));
queue->render(device);
// device->useShader (program);
// device->setTexture (stage, name, texture)
@@ -148,7 +150,8 @@ int main(int argc, char **argv)
//glBindTexture (GL_TEXTURE_2D, texture->getId() );
// device->
model->render();
//device->
//model->render();
simulation->saveStates();
simulation->updateSteps(_DeltaTime);
@@ -156,7 +159,7 @@ int main(int argc, char **argv)
;
scriptsystem->callFunction("OnFrame", _DeltaTime);
window->swap();
device->swap();
}
scriptsystem->callFunction("Shutdown");