本文整理汇总了C++中CDebug::RenderDebugLines方法的典型用法代码示例。如果您正苦于以下问题:C++ CDebug::RenderDebugLines方法的具体用法?C++ CDebug::RenderDebugLines怎么用?C++ CDebug::RenderDebugLines使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDebug
的用法示例。
在下文中一共展示了CDebug::RenderDebugLines方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderScene
void RenderScene()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity(); // Reset The matrix
// Position the camera
g_Camera.Look();
// Each frame we calculate the new frustum. In reality you only need to
// calculate the frustum when we move the camera.
g_Frustum.CalculateFrustum();
// Initialize the total node count that is being draw per frame
g_TotalNodesDrawn = 0;
/////// * /////////// * /////////// * NEW * /////// * /////////// * /////////// *
// Here we draw the octree, starting with the root node and recursing down each node.
// This time, we pass in the root node and just the original world model. You could
// just store the world in the root node and not have to keep the original data around.
// This is up to you. I like this way better because it's easy, though it could be
// more error prone.
g_Octree.DrawOctree(&g_Octree, &g_World);
// Render the cubed nodes to visualize the octree (in wire frame mode)
if( g_bDisplayNodes )
g_Debug.RenderDebugLines();
// Create a buffer to store the octree information for the title bar
static char strBuffer[255] = {0};
// Display in window mode the current subdivision information. We now display the
// max triangles per node, the max level of subdivision, total end nodes, current nodes drawn
// and frames per second we are receiving.
sprintf(strBuffer, "Triangles: %d Subdivisions: %d EndNodes: %d NodesDraw: %d FPS: %s",
g_MaxTriangles, g_MaxSubdivisions, g_EndNodeCount, g_TotalNodesDrawn, g_strFrameRate);
/////// * /////////// * /////////// * NEW * /////// * /////////// * /////////// *
// Set our window title bar to the subdivision information
SetWindowText(g_hWnd, strBuffer);
// Swap the backbuffers to the foreground
SwapBuffers(g_hDC);
}
示例2: RenderScene
void RenderScene()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
glLoadIdentity(); // Reset The matrix
// Give OpenGL our camera position
g_Camera.Look();
/////// * /////////// * /////////// * NEW * /////// * /////////// * /////////// *
// Each frame we calculate the new frustum. In reality you only need to
// calculate the frustum when we move the camera.
g_Frustum.CalculateFrustum();
// Initialize the total node count that is being draw per frame
g_TotalNodesDrawn = 0;
/////// * /////////// * /////////// * NEW * /////// * /////////// * /////////// *
// Here we draw the octree, starting with the root node and recursing down each node.
// When we get to each of the end nodes we will draw the vertices assigned to them.
g_Octree.DrawOctree(&g_Octree);
// Render the cube'd nodes to visualize the octree (in wire frame mode)
g_Debug.RenderDebugLines();
SwapBuffers(g_hDC); // Swap the backbuffers to the foreground
char strBuffer[255] = {0}; // Create a character buffer
// To view our octree information I set the window's title bar to the some basic
// information such as the max triangles per node, the max subdivisions,
// total end nodes and the total drawn end nodes that are currently in the frustum.
// Display in window mode the current subdivision information
sprintf(strBuffer, "MaxTriangles: %d MaxSubdivisions: %d TotalEndNodes: %d TotalNodesDraw: %d",
g_MaxTriangles, g_MaxSubdivisions, g_EndNodeCount, g_TotalNodesDrawn);
// Set our window title bar to the subdivision data
SetWindowText(g_hWnd, strBuffer);
}