本文整理汇总了C++中CrtRender::SetScreenHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ CrtRender::SetScreenHeight方法的具体用法?C++ CrtRender::SetScreenHeight怎么用?C++ CrtRender::SetScreenHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CrtRender
的用法示例。
在下文中一共展示了CrtRender::SetScreenHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResizeGLScreen
//----------------------------------------------------------------------------------------------------
// Resize And Initialize The GL Window
GLvoid ResizeGLScreen(GLsizei width, GLsizei height)
{
// Prevent A Divide By Zero By
if (height==0)
{
height=1;
}
glViewport(0,0,width,height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// Calculate The Aspect Ratio Of The Window
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
// Reset the renderer's screen size to the new size
_CrtRender.SetScreenWidth( width);
_CrtRender.SetScreenHeight( height);
}
示例2: WinMain
//----------------------------------------------------------------------------------------------------
// Standard windows mainline, this is the program entry point
//
CrtInt32 WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
CrtInt32 nCmdShow)
{
(void)hPrevInstance; // Avoid warnings
(void)nCmdShow; // Avoid warnings
(void)hInstance; // Avoid warnings
#ifndef NO_DEVIL
ilInit();
#endif
MSG msg;
BOOL done=FALSE;
// Avoid warnings later
msg.wParam = 0;
// Turns on windows heap debugging
#if HEAP_DEBUG
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_CHECK_CRT_DF /*| _CRTDBG_DELAY_FREE_MEM_DF*/);
#endif
// Ask The User Which Screen Mode They Prefer
// if (MessageBox(NULL,"Would You Like To Run In Fullscreen Mode?", "Start FullScreen?",MB_YESNO|MB_ICONQUESTION)==IDNO)
{
fullscreen=FALSE;
}
// Set the default screen size
_CrtRender.SetScreenWidth( 640);
_CrtRender.SetScreenHeight( 480);
// Create an OpenGL Window
if (!CreateGLWindow("Collada Viewer for PC", _CrtRender.GetScreenWidth(), _CrtRender.GetScreenHeight(),32,fullscreen))
{
return 0;
}
// Turn data dumping (debug) off
//CrtBool dumpData = CrtFalse;
// Initialize the renderer
// !!!GAC for compatibility with the new COLLADA_FX code, Init now forces UsingCg and UsingVBOs to
// !!!GAC false. It also calls CrtInitCg, creating the CG context and calling cgGLRegisterStates.
// !!!GAC All these things are currently required for the cfx rendering path to work, changing them
// !!!GAC may cause problems. This is work in progress and will be much cleaner when the refactor is done.
_CrtRender.Init();
//_CrtRender.SetRenderDebug( CrtTrue );
// !!!GAC kept for reference, changing these may cause problems with the cfx include path
//_CrtRender.SetUsingCg( CrtFalse );
// Turn off VBOs (the GL skinning path doesn't work with VBOs yet)
_CrtRender.SetUsingVBOs( CrtTrue );
_CrtRender.SetUsingNormalMaps( CrtTrue );
//_CrtRender.SetRenderDebug( CrtTrue );
//_CrtRender.SetUsingShadowMaps(CrtTrue);
// We might get a windows-style path on the command line, this can mess up the DOM which expects
// all paths to be URI's. This block of code does some conversion to try and make the input
// compliant without breaking the ability to accept a properly formatted URI. Right now this only
// displays the first filename
char
file[512],
*in = lpCmdLine,
*out = file;
*out = NULL;
// If the first character is a ", skip it (filenames with spaces in them are quoted)
if(*in == '\"')
{
in++;
}
if(*(in+1) == ':')
{
// Second character is a :, assume we have a path with a drive letter and add a slash at the beginning
*(out++) = '/';
}
int i;
for(i =0; i<512; i++)
{
// If we hit a null or a quote, stop copying. This will get just the first filename.
if(*in == NULL || *in == '\"')
break;
// Copy while swapping backslashes for forward ones
if(*in == '\\')
{
*out = '/';
}
else
{
*out = *in;
}
in++;
out++;
}
//.........这里部分代码省略.........