summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-04-04 00:01:39 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-04-04 00:01:39 +0200
commit095be9811eaccd92cee156b4c486fb92b77cdcd2 (patch)
tree354d6f28f0efd721748c0e052921b443ee86bd79 /main.cpp
parent61fe986e9ad6d1f26275e2ffd72cae0c2542256c (diff)
Threaded VBO creation.
A secondary memory-mapped VBO is filled in a separate thread, which replaces the main VBO when work is done.
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/main.cpp b/main.cpp
index 5f089e8..eee70dd 100644
--- a/main.cpp
+++ b/main.cpp
@@ -76,24 +76,14 @@ int main(int argc, char **argv) {
bool gravity = true;
SDL_WarpMouse(video::width/2, video::height/2);
unsigned int last_time = SDL_GetTicks();
- unsigned int last_update = SDL_GetTicks();
- /*boost::timer t;
- double last_time = 0;*/
Vector3 selected;
Quadtree::QuadNode *node;
Quadtree::QuadNode *last_node = NULL;
scene.update();
while(running) {
unsigned int time = SDL_GetTicks();
- //double time = t.elapsed();
- //t.restart();
unsigned int steps = time - last_time + 1;
- //double steps = (time - last_time) * 1000;
last_time = time;
- /*if(time - last_update > 5000) {
- scene.update();
- last_update = time;
- }*/
bool do_select = 0;
int sx, sy;
while(SDL_PollEvent(&event)) {
@@ -297,8 +287,8 @@ int main(int argc, char **argv) {
float height = font->LineHeight();
glColor3f(1, 1, 1);
glTranslatef(0, video::height-height, 0);
- font->Render((boost::format("%dx%d %d levels %d nodes tree creation time: %f steps: %d")
- % scene.qt->width % scene.qt->height % scene.qt->levels % scene.qt->nodes % scene.qt->init_time % steps).str().c_str());
+ font->Render((boost::format("%dx%d %d levels %d nodes tree creation time: %f steps: %d update: %d")
+ % scene.qt->width % scene.qt->height % scene.qt->levels % scene.qt->nodes % scene.qt->init_time % steps % scene.qt->thread_running).str().c_str());
//glTranslatef(0, height, 0);
//font->Render((boost::format("selected: %x") % selected).str().c_str());
glTranslatef(0, -height, 0);