Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Thu Mar 28, 2024 10:32 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun May 06, 2007 12:55 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I had problems with the raydium_osd_printf when i was implementing a debug mode for the bones in the bvh system.
I have noticed that if i use the raydium_osd_printf, then all the stuff of the debug is not showing!!!!!
Finally i have found the problem. In the function raydium_osd_printf there is one commented linea almost the bottom.
The line is:
//raydium_rendering_internal_restore_render_state();

I have de-commented and everything is going well. There was a good reason to have that line commented before?


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 06, 2007 4:05 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Well, all this is far away but IIRC, the reason for commenting this line was something like "it's not it's job. this function is here to draw, not to take care of the rendering pipeline". It was supposed to make all this faster.

In other words, the "problem" is probably at the beginning of your debug code. How do you initialize your debug rendering ?


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 06, 2007 6:05 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Code:
if(RAYDIUM_BVH_DEBUG)
  {     

        glPushMatrix();
        raydium_osd_color_change(1,0,0);             
        raydium_osd_printf_3D(node->x,node->y,node->z,12,0.5,"font2.tga"," %s",TypeToName(node->type));
        glPointSize(7);
        glBegin(GL_POINTS);
        glVertex3f(node->x,node->y,node->z);
        glEnd();
        glPointSize(1);
        glColor3f(1,0,0);
        glBegin(GL_LINES);

        glVertex3i(node->x,node->y,node->z);

        glVertex3f(node->x+5,node->y,node->z);

        glEnd();
        glColor3f(0,1,0);
        glBegin(GL_LINES);

        glVertex3i(node->x,node->y,node->z);

        glVertex3f(node->x,node->y+5,node->z);

        glEnd();
        glColor3f(0,0,1);
        glBegin(GL_LINES);

        glVertex3i(node->x,node->y,node->z);

        glVertex3f(node->x,node->y,node->z+5);

        glEnd();
        glPopMatrix();       
  }


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 06, 2007 9:43 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Yep, the problem is here. With Raydium, before drawing anything "by yourself", you must prepare the rendering pipeline. It can be done with a lot of different ways, like setting a texture or reseting the pipeline state. And that's why the raydium_rendering_internal_restore_render_state() function was created for.

So you should call this right before your first glBegin(), it will probably fix this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 30 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group