本文整理汇总了C++中TextureManager::CreatePicture方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureManager::CreatePicture方法的具体用法?C++ TextureManager::CreatePicture怎么用?C++ TextureManager::CreatePicture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextureManager
的用法示例。
在下文中一共展示了TextureManager::CreatePicture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WndProc
//.........这里部分代码省略.........
editor.showText();
}
break;
case 'y':
case 'Y':
if (GetAsyncKeyState(VK_CONTROL) < 0)
{
editor.redo();
char errorText[MAX_ERROR_LENGTH];
char *shaderText;
shaderText = editor.getText();
if (shaderManager.updateShader(usedShader[usedIndex], shaderText, errorText))
{
editor.setErrorText(errorText);
}
else editor.unshowError();
editor.showText();
}
break;
case 'm':
case 'M':
if (GetAsyncKeyState(VK_CONTROL) < 0)
{
// TODO: Minimization again.
SetWindowLong(hWnd, GWL_STYLE, WS_POPUP|WS_VISIBLE);
ShowWindow(hWnd, SW_MAXIMIZE);
GetClientRect(hWnd, &windowRect);
glViewport(0, 0, windowRect.right-windowRect.left, abs(windowRect.bottom - windowRect.top)); //NEW
aspectRatio = (float)(windowRect.right-windowRect.left) / (float)(abs(windowRect.bottom - windowRect.top));
ShowCursor(false);
}
break;
case 's':
case 'S':
// We want a new shader
if (GetAsyncKeyState(VK_CONTROL) < 0)
{
char errorText[MAX_ERROR_LENGTH];
char *shaderText;
shaderText = editor.getText();
if (shaderManager.updateShader(usedShader[usedIndex], shaderText, errorText))
{
//MessageBox(wininfo.hWnd, errorText, "Shader change", MB_OK);
editor.setErrorText(errorText);
}
else
{
// It worked, so save the shader
shaderManager.saveProgress(usedShader[usedIndex], errorText, &editor);
editor.unshowError();
editor.unshowText();
}
// Save sprites to file
textureManager.CreatePicture("TODO.tga");
}
break;
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
if (GetAsyncKeyState(VK_CONTROL) < 0)
{
// I use the ordering of keys to be able to get to the shader...
usedIndex = wParam - '1';
if (usedIndex >= NUM_USED_PROGRAMS) usedIndex = NUM_USED_PROGRAMS - 1;
char errorText[MAX_ERROR_LENGTH+1];
char filename[SM_MAX_FILENAME_LENGTH+1];
sprintf_s(filename, SM_MAX_FILENAME_LENGTH, "shaders/%s", usedShader[usedIndex]);
if (editor.loadText(filename, errorText))
{
MessageBox(wininfo.hWnd, errorText, "Editor init", MB_OK);
return -1;
}
}
break;
default:
break;
}
}
// Text entering
if (uMsg==WM_CHAR && GetAsyncKeyState(VK_CONTROL) >= 0)
{
editor.putCharacter(wParam);
}
return( DefWindowProc(hWnd,uMsg,wParam,lParam) );
}