summaryrefslogtreecommitdiff
path: root/win/Terrwnd.cpp
diff options
context:
space:
mode:
authorleo2000-08-24 21:24:42 +0000
committerleo2000-08-24 21:24:42 +0000
commit31a1d493ed4ca5d263244a8a3231111a58bdc5c4 (patch)
tree9963c933eb4fe42f257db26c7938009c4a88b0f4 /win/Terrwnd.cpp
parente54d0ecfb00132cb4eeafb7d909f89c93a7b3ca6 (diff)
Updated the Windows version with the new Minifig Wizard.
Fixed some OpenGL problems on the Windows version. git-svn-id: http://svn.leocad.org/trunk@106 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win/Terrwnd.cpp')
-rw-r--r--win/Terrwnd.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/win/Terrwnd.cpp b/win/Terrwnd.cpp
index 68b706c..2708cc7 100644
--- a/win/Terrwnd.cpp
+++ b/win/Terrwnd.cpp
@@ -63,8 +63,8 @@ void CTerrainWnd::OnPaint()
{
CPaintDC dc(this); // device context for painting
- HDC oldDC = wglGetCurrentDC();
- HGLRC oldRC = wglGetCurrentContext();
+ HDC oldDC = pfnwglGetCurrentDC();
+ HGLRC oldRC = pfnwglGetCurrentContext();
if (m_pPalette)
{
@@ -72,7 +72,7 @@ void CTerrainWnd::OnPaint()
m_pDC->RealizePalette();
}
- wglMakeCurrent(m_pDC->m_hDC, m_hglRC);
+ pfnwglMakeCurrent(m_pDC->m_hDC, m_hglRC);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -83,9 +83,9 @@ void CTerrainWnd::OnPaint()
m_pTerrain->Render(m_pCamera, aspect);
- glFlush();
- SwapBuffers(dc.m_hDC);
- wglMakeCurrent (oldDC, oldRC);
+ glFlush();
+ pfnwglSwapBuffers (dc.m_hDC);
+ pfnwglMakeCurrent (oldDC, oldRC);
}
void CTerrainWnd::OnSize(UINT nType, int cx, int cy)
@@ -109,7 +109,7 @@ void CTerrainWnd::OnDestroy()
}
if (m_hglRC)
- wglDeleteContext(m_hglRC);
+ pfnwglDeleteContext(m_hglRC);
if (m_pDC)
delete m_pDC;
@@ -136,11 +136,11 @@ int CTerrainWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
pfd.cDepthBits = 32;
pfd.iLayerType = PFD_MAIN_PLANE;
- int nPixelFormat = ChoosePixelFormat(m_pDC->m_hDC, &pfd);
+ int nPixelFormat = pfnwglChoosePixelFormat(m_pDC->m_hDC, &pfd);
if (nPixelFormat == 0)
return -1;
- if (!SetPixelFormat(m_pDC->m_hDC, nPixelFormat, &pfd))
+ if (!pfnwglSetPixelFormat(m_pDC->m_hDC, nPixelFormat, &pfd))
return -1;
m_pPalette = new CPalette;
@@ -156,13 +156,13 @@ int CTerrainWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
}
// Create a rendering context.
- m_hglRC = wglCreateContext(m_pDC->m_hDC);
+ m_hglRC = pfnwglCreateContext(m_pDC->m_hDC);
if (!m_hglRC)
return -1;
- HDC oldDC = wglGetCurrentDC();
- HGLRC oldRC = wglGetCurrentContext();
- wglMakeCurrent (m_pDC->m_hDC, m_hglRC);
+ HDC oldDC = pfnwglGetCurrentDC();
+ HGLRC oldRC = pfnwglGetCurrentContext();
+ pfnwglMakeCurrent (m_pDC->m_hDC, m_hglRC);
// Initialize OpenGL the way we want it.
float ambient [] = {0.0f, 0.0f, 0.0f, 1.0f};
@@ -184,19 +184,19 @@ int CTerrainWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
glEnable(GL_COLOR_MATERIAL);
glEnable(GL_CULL_FACE);
- wglMakeCurrent(oldDC, oldRC);
+ pfnwglMakeCurrent(oldDC, oldRC);
return 0;
}
void CTerrainWnd::LoadTexture(bool linear)
{
- HDC oldDC = wglGetCurrentDC();
- HGLRC oldRC = wglGetCurrentContext();
+ HDC oldDC = pfnwglGetCurrentDC();
+ HGLRC oldRC = pfnwglGetCurrentContext();
- wglMakeCurrent(m_pDC->m_hDC, m_hglRC);
+ pfnwglMakeCurrent(m_pDC->m_hDC, m_hglRC);
m_pTerrain->LoadTexture(linear);
- wglMakeCurrent(oldDC, oldRC);
+ pfnwglMakeCurrent(oldDC, oldRC);
}
void CTerrainWnd::OnLButtonDown(UINT nFlags, CPoint point)