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


C++ LOG::OutputNewline方法代码示例

本文整理汇总了C++中LOG::OutputNewline方法的典型用法代码示例。如果您正苦于以下问题:C++ LOG::OutputNewline方法的具体用法?C++ LOG::OutputNewline怎么用?C++ LOG::OutputNewline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LOG的用法示例。


在下文中一共展示了LOG::OutputNewline方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Shutdown

void WINDOW::Shutdown(void)									//PROPERLY KILL WINDOW
{
	//Delete font display lists
	glDeleteLists(base, 96);

	if (fullscreen)
	{
		ChangeDisplaySettings(NULL, 0);						//restore desktop mode
		ShowCursor(TRUE);									//show mouse cursor
	}
	
	errorLog.OutputNewline();
		
	if(hRC)													//have a rendering context?
	{
		if(!wglMakeCurrent(NULL, NULL))					//try to release rend cont
		{
			errorLog.OutputError("Release of DC and RC Failed.");
		}
		else
			errorLog.OutputSuccess("DC and RC released.");

		if(!wglDeleteContext(hRC))							//try to delete RC
		{
			errorLog.OutputError("Release Rendering Context Failed.");
		}
		else
			errorLog.OutputSuccess("Rendering Context Released.");

		hRC=NULL;											//set RC to NULL
	}

	if(hDC && !ReleaseDC(hWnd, hDC))						//Are we able to release DC?
	{
		errorLog.OutputError("Release of Device Context Failed.");
		hDC=NULL;
	}
	else
		errorLog.OutputSuccess("Device Context Released.");

	if(hWnd && !DestroyWindow(hWnd))						//Can we destroy window?
	{
		errorLog.OutputError("Could not release hWnd");
		hWnd=NULL;
	}
	else
		errorLog.OutputSuccess("hWnd released.");

	if (!UnregisterClass("OpenGL", hInstance))				 //can we unreg. class?
	{
		errorLog.OutputError("Could Not Unregister Class.");
		hInstance=NULL;
	}
	else
		errorLog.OutputSuccess("Class unregistered.");
}
开发者ID:Distrotech,项目名称:mesa-demos,代码行数:56,代码来源:window.cpp

示例2: Init


//.........这里部分代码省略.........
		0, 0, 0												//layer masks ignored
	};

	if(!(hDC=GetDC(hWnd)))								//did we get a device context?
	{													//if not
		Shutdown();									//Reset display
		errorLog.OutputError("Can't Create a GL Device context.");
		return FALSE;									//return false, to exit
	}
	else
		errorLog.OutputSuccess("DC Created");
	
	if(!(pixelFormat=ChoosePixelFormat(hDC,&pfd)))	//found a matching pixel format?
	{													//if not
		Shutdown();
		errorLog.OutputError("Can't Find a Suitable PixelFormat.");
		return FALSE;
	}
	else
		errorLog.OutputSuccess("Pixel Format Found.");

	if(!SetPixelFormat(hDC, pixelFormat,&pfd))		//are we able to set pixel format?
	{													//if not
		Shutdown();
		errorLog.OutputError("Can't set the pixelformat.");
		return FALSE;
	}
	else
		errorLog.OutputSuccess("Pixel Format set.");

	if(!(hRC=wglCreateContext(hDC)))					//are we able to get rendering context?
	{													//if not
		Shutdown();
		errorLog.OutputError("Can't create a GL rendering context.");
		return FALSE;
	}
	else
		errorLog.OutputSuccess("GL Rendering Context Created.");

	if(!MakeCurrent())						//are we able to activate rendering context?
	{													//if not
		Shutdown();
		return FALSE;
	}
	else
		errorLog.OutputSuccess("GL Rendering Context Activated.");

	//get pixel format parameters
	static PIXELFORMATDESCRIPTOR finalPfd;
	DescribePixelFormat(hDC, pixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &finalPfd);

	//output window parameters
	errorLog.OutputNewline();
	errorLog.OutputSuccess("Window Size: (%d, %d)", width, height);
	errorLog.OutputSuccess("Color Buffer Bits (R, G, B, A): (%d, %d, %d, %d)",
								finalPfd.cRedBits,
								finalPfd.cGreenBits,
								finalPfd.cBlueBits,
								finalPfd.cAlphaBits);
	errorLog.OutputSuccess("Depth Buffer Bits: %d", finalPfd.cDepthBits);
	errorLog.OutputSuccess("Stencil Buffer Bits: %d", finalPfd.cStencilBits);
	errorLog.OutputNewline();
	
	ShowWindow(hWnd,SW_SHOW);							//show window
	SetForegroundWindow(hWnd);							//slightly higher priority
	SetFocus(hWnd);										//Set keyboard focus to the window
	
	errorLog.OutputSuccess("Window Created!");
	errorLog.OutputNewline();

	//Init the font
	HFONT font;											//windows font ID

	//create 96 display lists
	base = glGenLists(96);

	font	=	CreateFont(	-18,						//font height
							0,							//default width
							0, 0,						//angles - escapement, orientation
							FW_BOLD,					//font weight, 0-1000, NORMAL, BOLD
							false,						//italic
							false,						//underline
							false,						//strikeout
							ANSI_CHARSET,				//character set
							OUT_TT_PRECIS,				//precision
							CLIP_DEFAULT_PRECIS,		//clip precision
							ANTIALIASED_QUALITY,		//output quality
							FF_DONTCARE | DEFAULT_PITCH,//family and pitch
							"Courier New");				//font name

	//select the font
	SelectObject(hDC, font);

	//create 96 display lists, starting at 32
	wglUseFontBitmaps(hDC, 32, 96, base);
	
	errorLog.OutputSuccess("Font created successfully.");
	
	return TRUE;										//success!
}
开发者ID:Distrotech,项目名称:mesa-demos,代码行数:101,代码来源:window.cpp


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