本文整理汇总了C++中CrtRender::Destroy方法的典型用法代码示例。如果您正苦于以下问题:C++ CrtRender::Destroy方法的具体用法?C++ CrtRender::Destroy怎么用?C++ CrtRender::Destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CrtRender
的用法示例。
在下文中一共展示了CrtRender::Destroy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DestroyCrt
static void DestroyCrt(void)
{
_CrtRender.Destroy();
DestroyGLWindow();
}
示例2: onShutdown
void COLLADA_Viewer::onShutdown()
{
FWGLApplication::onShutdown();
_CrtRender.Destroy();
cellDbgFontConsoleClose(mDbgFontID);
cellDbgFontExit();
}
示例3: WinMain
//.........这里部分代码省略.........
int nvalues;
CGannotation thisCGAnnotation = cgGetFirstParameterAnnotation(thisCGParameter);
// Iterate over all the annotations
while(thisCGAnnotation != NULL)
{
// Get the name of this annotation
const char *annotationName = cgGetAnnotationName(thisCGAnnotation);
// Do case-blind compares to see if the annotation is one of the ones used to make UI
// and save the value if it is.
if(CrtICmp("UIWidget",annotationName))
{
// This is the widget type
UIWidget = cgGetStringAnnotationValue(thisCGAnnotation);
}
if(CrtICmp("UIName",annotationName))
{
// This is the name to attach to the widget
UIName = cgGetStringAnnotationValue(thisCGAnnotation);
}
if(CrtICmp("UIMin",annotationName))
{
// This is the minimum value for a slider widget
const float *value = cgGetFloatAnnotationValues(thisCGAnnotation, &nvalues);
if(nvalues == 1)
UIMin = *value;
}
if(CrtICmp("UIMax",annotationName))
{
// This is the maximum value for a slider widget
const float *value = cgGetFloatAnnotationValues(thisCGAnnotation, &nvalues);
if(nvalues == 1)
UIMax = *value;
}
if(CrtICmp("UIStep",annotationName))
{
// This is the step (minimum change) for a slider widget
const float *value = cgGetFloatAnnotationValues(thisCGAnnotation, &nvalues);
if(nvalues == 1)
UIStep = *value;
}
// Get the next annotation
thisCGAnnotation = cgGetNextAnnotation(thisCGAnnotation);
}
// Is the UIWidget a type that we recognize? (just slider and color picker for now)
// Replace the CrtPrint with the code that generates the UI, remember the UI needs to
// store thisCGParameter someplace so it can use it to change the parameter later.
if(CrtICmp("slider", UIWidget))
{
CrtPrint("Parameter %s needs a slider named %s going from %f to %f with step %f\n",parameterName,UIName,UIMin,UIMax, UIStep );
}
if(CrtICmp("color", UIWidget))
{
CrtPrint("Parameter %s needs a color picker named %s\n",parameterName,UIName);
}
// Move on to the next parameter
thisCGParameter = cgGetNextParameter(thisCGParameter);
}
// Move on to the next effect
effectIterator++;
}
}
#endif
while(!done)
{
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
if (msg.message==WM_QUIT)
{
done=TRUE;
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
else
{
// Draw The Scene. Watch For ESC Key And Quit Messages From DrawGLScene()
if ((active && !DrawGLScene()) || keys[VK_ESCAPE]) // Active? Was There A Quit Received?
{
done=TRUE;
}
else
{
SwapBuffers(hDC);
ProcessInput( keys );
}
}
}
_CrtRender.Destroy();
// Shutdown
#ifndef NO_DEVIL
ilShutDown();
#endif
DestroyGLWindow();
return (int)(msg.wParam);
}
示例4: ProcessInput
// Call ProcessInput once per frame to process input keys
void ProcessInput( bool keys[] )
{
// These keys we don't want to auto-repeat, so we clear them in "keys" after handling them once
if (keys['E'] && amplitudeGlobalParameter)
{
float value;
cgGetParameterValuefc(amplitudeGlobalParameter, 1, &value);
value += 0.1f;
cgSetParameter1f(amplitudeGlobalParameter, value);
keys['E'] = false;
}
if (keys['R'] && amplitudeGlobalParameter)
{
float value;
cgGetParameterValuefc(amplitudeGlobalParameter,1, &value);
value -= 0.1f;
cgSetParameter1f(amplitudeGlobalParameter, value);
keys['R'] = false;
}
if (keys[VK_TAB] )
{
// When 'C' is pressed, change cameras
_CrtRender.SetNextCamera();
keys[VK_TAB] = false;
}
if ( keys['M'] )
{
// Speed up UI by 25%
AdjustUISpeed(1.25f);
keys['M'] = false;
}
if ( keys['N'] )
{
// Slow down UI by 25%
AdjustUISpeed(0.75f); // Go 25% slower
keys['N'] = false;
}
if (keys['Q'])
{
if (togglewireframe) {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
togglewireframe = FALSE;
} else {
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
togglewireframe = TRUE;
}
keys['Q'] = false;
}
if (keys['K'])
{
if (togglehiearchy) {
_CrtRender.SetShowHiearchy(CrtTrue);
togglehiearchy = FALSE;
} else {
_CrtRender.SetShowHiearchy(CrtFalse);
togglehiearchy = TRUE;
}
keys['K'] = false;
}
if (keys['L'])
{
if (togglelighting) {
glDisable(GL_LIGHTING);
togglelighting = FALSE;
} else {
glEnable(GL_LIGHTING);
togglelighting = TRUE;
}
keys['L'] = false;
}
if (keys['P'] )
{
if (sAnimationEnable) {
_CrtRender.SetAnimationPaused( CrtTrue );
sAnimationEnable = false;
}
else {
_CrtRender.SetAnimationPaused( CrtFalse );
sAnimationEnable = true;
}
keys['P'] = false;
}
if (keys[VK_F1])
{
keys[VK_F1]=FALSE;
_CrtRender.Destroy();
DestroyGLWindow();
fullscreen=!fullscreen;
// Recreate Our OpenGL Window
if (!CreateGLWindow("Collada Viewer for PC", _CrtRender.GetScreenWidth(), _CrtRender.GetScreenHeight(),32,fullscreen))
{
exit(1);
}
if ( !_CrtRender.Load( cleaned_file_name ))
{
exit(0);
//.........这里部分代码省略.........