本文整理汇总了C++中GLContext::init方法的典型用法代码示例。如果您正苦于以下问题:C++ GLContext::init方法的具体用法?C++ GLContext::init怎么用?C++ GLContext::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLContext
的用法示例。
在下文中一共展示了GLContext::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createGLContext
GLContext* PlatformWin::createGLContext( GameWindow& window , GLConfig& config )
{
GLContext* context = new GLContext;
if ( !context->init( window , config ) )
{
delete context;
return NULL;
}
return context;
}
示例2: InitInstance
// In this function, we save the instance handle, then create and display the main program window.
BOOL SingleFace::InitInstance(HINSTANCE hInstance, PWSTR lpCmdLine, int nCmdShow)
{
m_hInst = hInstance; // Store instance handle in our global variable
ParseCmdString(lpCmdLine);
WCHAR szTitle[MaxLoadStringChars]; // The title bar text
LoadString(m_hInst, IDS_APP_TITLE, szTitle, ARRAYSIZE(szTitle));
static const PCWSTR RES_MAP[] = { L"80x60", L"320x240", L"640x480", L"1280x960" };
static const PCWSTR IMG_MAP[] = { L"PLAYERID", L"RGB", L"YUV", L"YUV_RAW", L"DEPTH" };
// Add mode params in title
WCHAR szTitleComplete[MAX_PATH];
swprintf_s(szTitleComplete, L"%s -- Depth:%s:%s Color:%s:%s NearMode:%s, SeatedSkeleton:%s", szTitle,
IMG_MAP[m_depthType], (m_depthRes < 0)? L"ERROR": RES_MAP[m_depthRes], IMG_MAP[m_colorType], (m_colorRes < 0)? L"ERROR": RES_MAP[m_colorRes], m_bNearMode? L"ON": L"OFF",
m_bSeatedSkeletonMode?L"ON": L"OFF");
WCHAR szWindowClass[MaxLoadStringChars]; // the main window class name
LoadString(m_hInst, IDC_SINGLEFACE, szWindowClass, ARRAYSIZE(szWindowClass));
RegisterClass(szWindowClass);
m_hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SINGLEFACE));
m_pImageBuffer = FTCreateImage();
m_pVideoBuffer = FTCreateImage();
m_hWnd = CreateWindow(szWindowClass, szTitleComplete, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, WINDOWWIDTH, WINDOWHEIGHT, NULL, NULL, m_hInst, this);
if (!m_hWnd)
{
return FALSE;
}
ShowWindow(m_hWnd, nCmdShow);
UpdateWindow(m_hWnd);
#ifdef USEOPENGL
m_GLContext.init(m_hWnd);
InitGL();
#endif
return SUCCEEDED(m_FTHelper.Init(m_hWnd,
FTHelperCallingBack,
this,
m_depthType,
m_depthRes,
m_bNearMode,
TRUE, // if near mode doesn't work, fall back to default mode
m_colorType,
m_colorRes,
m_bSeatedSkeletonMode));
}