当前位置: 首页>>代码示例>>C++>>正文


C++ CDebug::RenderDebugLines方法代码示例

本文整理汇总了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);									
}
开发者ID:Allenjonesing,项目名称:tutorials,代码行数:46,代码来源:Main.cpp

示例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);
}
开发者ID:jiangguang5201314,项目名称:ZNginx,代码行数:41,代码来源:Main.cpp


注:本文中的CDebug::RenderDebugLines方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。