/// CXXXView.cpp
void CXXXView::OnInitialUpdate()
{
CView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
if (m_eglDisplay != EGL_NO_DISPLAY)
return;
const EGLint attrs[] = {
EGL_LEVEL, 0,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_NATIVE_RENDERABLE, EGL_FALSE,
EGL_DEPTH_SIZE, EGL_DONT_CARE,
EGL_NONE
};
EGLint numConfig =0;
m_eglDisplay = eglGetDisplay(GetDC()->GetSafeHdc());
if (m_eglDisplay == EGL_NO_DISPLAY)
if ((m_eglDisplay = eglGetDisplay((EGLNativeDisplayType) EGL_DEFAULT_DISPLAY)) == EGL_NO_DISPLAY)
return;
// Initialize the display
EGLint major = 0;
EGLint minor = 0;
if (!eglInitialize(m_eglDisplay, &major, &minor))
return;
if (major < 1 || minor < 3)
{
// Does not support EGL 1.3
printf("System does not support at least EGL 1.3 \n");
return;
}
EGLConfig eglConfig;
// Obtain the first configuration with a depth buffer
if (!eglChooseConfig(m_eglDisplay, attrs, &eglConfig, 1, &numConfig))
return;
// Create a surface for the main window
if ((m_eglSurface = eglCreateWindowSurface(m_eglDisplay, eglConfig, (EGLNativeWindowType) GetSafeHwnd(), NULL)) == EGL_NO_SURFACE)
return;
// Bind the API (It could be OpenGLES or OpenVG)
// eglBindAPI(EGL_OPENGL_ES_API);
EGLint ai32ContextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
// Create an OpenGL ES context
if ((m_eglContext = eglCreateContext(m_eglDisplay, eglConfig, EGL_NO_CONTEXT, ai32ContextAttribs)) == EGL_NO_CONTEXT)
return;
// Make the context and surface current
if (!eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext))
return;
///
glClearColor(0.5f, 0.5f, 0.5f, 0.0f);
}
void CXXXView::PostNcDestroy()
{
// TODO: Add your specialized code here and/or call the base class
eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(m_eglDisplay, m_eglContext);
eglDestroySurface(m_eglDisplay, m_eglSurface);
eglTerminate(m_eglDisplay);
CView::PostNcDestroy();
}
void CXXXView::onDraw(void)
{
glClear(GL_COLOR_BUFFER_BIT);
///
IGameImporter * gameImport = NULL;
auto pDoc = GetDocument();
if (pDoc && pDoc->IsKindOf(RUNTIME_CLASS(CXXXDoc)))
gameImport = dynamic_cast (pDoc)->getGameImport();
///
eglSwapBuffers(m_eglDisplay, m_eglSurface);
}
BOOL CXXXView::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
/// return CView::OnEraseBkgnd(pDC);
return FALSE;
}
void CXXXView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
glViewport(0, 0, cx, cy);
}
/// CXXXApp.cpp
BOOL CXXXApp::OnIdle(LONG lCount)
{
// TODO: Add your specialized code here and/or call the base class
// return CWinAppEx::OnIdle(lCount);
CMainFrame * pFrame = (CMainFrame *) AfxGetMainWnd();
CView * pView = pFrame->GetActiveView();
if (pView && pView->IsKindOf(RUNTIME_CLASS(CXXXView)))
dynamic_cast (pView)->onDraw();
return TRUE;
}
/// CViewTree.h
#define WM_TVN_SELCHANGED (WM_USER+3)
class CViewTree : public CTreeCtrl
{
public:
afx_msg void OnTvnSelchanged(NMHDR *pNMHDR, LRESULT *pResult);
};
/// CViewTree.cpp
BEGIN_MESSAGE_MAP(CViewTree, CTreeCtrl)
ON_NOTIFY_REFLECT(TVN_SELCHANGED, &CViewTree::OnTvnSelchanged)
END_MESSAGE_MAP()
void CViewTree::OnTvnSelchanged(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTREEVIEW pNMTreeView = reinterpret_cast(pNMHDR);
// TODO: Add your control notification handler code here
GetParent()->SendNotifyMessage(WM_TVN_SELCHANGED, (WPARAM) pNMTreeView, (LPARAM) pResult);
*pResult = 0;
}
๐ ️ Code Note & Usage
* Human + AI Collaboration: ์ฌ๊ธฐ ๋ฌธ์์ ์ฝ๋๋ ์ ๊ฐ ์ํฐ๋ฆฌ๋ก ๊ตฌ์กฐ๋ฅผ ์ก๊ณ , Google AI (๊ตฌ๊ธ๊ฒ์ AI ๋ชจ๋)๋ฅผ ๋ฌ๋ฌ ๋ณถ์๊ฐ๋ฉฐ(?) ์์ฑํ ์ํฐ๋ฆฌ ์ฝ๋ ๋ญ์น๋ค ์
๋๋ค.
* Free to Use: ๊ฐ์ธ์ ์ธ ์ทจ๋ฏธ๋ก ์ ๋ฆฌํ ๋ฌธ์์ ์ํฐ๋ฆฌ ์ฝ๋ ๋ญ์น ์ง๋ง, ๊ณต๋ถ ํ์ค๋ ์กฐ๊ธ์ด๋๋ง ๋์์ด ๋์ ๋ค๋ฉด ์์ ๋กญ๊ฒ ๊ฐ์ ธ๊ฐ์ ์ฌ์ฉํ์ค ์ ์๋๋ก ๊ณต๊ฐํฉ๋๋ค!
* ⚠️ Warning: ์ฌ๊ธฐ ์ํฐ๋ฆฌ ์ฝ๋ ๋ญ์น๋ฅผ, ๊ฐ์ ธ๊ฐ์ ๊ธฐํ์ฝ ๊ผญ ์ฌ์ฉ ํ์ ๋ค๋ฉด ๊ผญ ๋ณธ์ธ์ ํ๊ฒฝ์ ๋ง๊ฒ ๋ฒ๊ทธ๋ ์๋ฌ๋ฅผ ๊ผญ ํ ๋ฒ ๋ ํ์ธ(์ฃผ์)ํ๊ณ ์ฌ์ฉํด ์ฃผ์ธ์.
※ ์ฝ๋๋ฅผ ์ฌ์ฉํ ๋๋ ํญ์ ์ฃผ์๊ฐ ํ์ํฉ๋๋ค. ※
2011๋ 3์ 8์ผ ํ์์ผ
OpenGL ES 2.0 + MFC
๋ค, WASM์ ์คํํ๊ณ ๊ด๋ฆฌํ๋ ์คํ ํ์ค๊ณผ ๋๊ตฌ๋ค์ ์ด๋ฏธ ์๋ฒฝํ๊ฒ ์ ์ฐฉ๋์ด ์ ์ธ๊ณ์ ์ผ๋ก ์ฐ์ด๊ณ ์์ต๋๋ค.
WASM์ด ์น ๋ธ๋ผ์ฐ์ ๋ฐ์ผ๋ก ๋์ ์๋ฒ์ AI ์ํ๊ณ์ ํ์ค์ด ๋ ์ ์์๋ ๊ฒ์ ์๋ ์์ด๋ ์น ์ปจ์์์(W3C)๊ณผ ๋ฐ์ดํธ์ฝ๋ ์ผ๋ผ์ด์ธ์ค(Bytecode Alliance) ๊ฐ์ ๊ธ๋ก๋ฒ ํ์ค ๊ธฐ๊ตฌ๋ค์ด ์๋ ์ ๊ฑธ์ณ ๋ช ํํ ๊ท๊ฒฉ์ ํ๋ฆฝํด ๋์๊ธฐ...
-
bool atob(const char * string) { if (!strcmp(string, "true")) return true; return false; }
-
Environment Variables: MAXSDKPATH=C:\Program Files (x86)\Autodesk\3ds Max 2010 SDK Sample source http://download.autodesk.com/media/...
-
/// CXXXView.cpp void CXXXView::OnInitialUpdate() { CView::OnInitialUpdate(); // TODO: Add your specialized code here and/or call the ...
๋๊ธ ์์:
๋๊ธ ์ฐ๊ธฐ