summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo2001-01-29 23:56:08 +0000
committerleo2001-01-29 23:56:08 +0000
commit91aa552f967eb0645fff45fb4ef3914839d43fcc (patch)
tree57038cfeff96de2f614f77a5e785e982bbd89276
parent284ee630366231f6a0c893c9b3d3ce1d62b925d6 (diff)
Moved the old Minifig Wizard window to the new GLWindow and MinifigWizard classes
git-svn-id: http://svn.leocad.org/trunk@236 c7d43263-9d01-0410-8a33-9dba5d9f93d6
-rw-r--r--win/LeoCAD.dsp31
-rw-r--r--win/Mfwnd.cpp141
-rw-r--r--win/Mfwnd.h56
3 files changed, 0 insertions, 228 deletions
diff --git a/win/LeoCAD.dsp b/win/LeoCAD.dsp
index e782bb9..3955c11 100644
--- a/win/LeoCAD.dsp
+++ b/win/LeoCAD.dsp
@@ -211,13 +211,6 @@ USERDEP__LEOCA="$(ProjDir)\hlp\AfxCore.rtf" "$(ProjDir)\hlp\AfxPrint.rtf"
# Begin Source File
SOURCE=.\Leocad.rc
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
-!ENDIF
-
# End Source File
# Begin Source File
@@ -1087,15 +1080,7 @@ SOURCE=..\Common\light.h
# Begin Source File
SOURCE=..\common\mainwnd.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
@@ -1195,15 +1180,7 @@ SOURCE=..\Common\quant.h
# Begin Source File
SOURCE=..\common\str.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
@@ -1256,15 +1233,7 @@ SOURCE=..\Common\vector.h
# Begin Source File
SOURCE=..\common\view.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
diff --git a/win/Mfwnd.cpp b/win/Mfwnd.cpp
deleted file mode 100644
index 83ee3b3..0000000
--- a/win/Mfwnd.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-// GLWindow.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "LeoCAD.h"
-#include "MFWnd.h"
-#include "Tools.h"
-#include "minifig.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CMinifigWnd
-
-CMinifigWnd::CMinifigWnd()
-{
- m_pDC = NULL;
-}
-
-CMinifigWnd::~CMinifigWnd()
-{
-}
-
-BEGIN_MESSAGE_MAP(CMinifigWnd, CWnd)
- //{{AFX_MSG_MAP(CMinifigWnd)
- ON_WM_ERASEBKGND()
- ON_WM_PAINT()
- ON_WM_DESTROY()
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CMinifigWnd message handlers
-
-int CMinifigWnd::InitGL()
-{
- m_pDC = new CClientDC(this);
- ASSERT(m_pDC != NULL);
-
- // Fill in the Pixel Format Descriptor
- PIXELFORMATDESCRIPTOR pfd;
- memset(&pfd,0, sizeof(PIXELFORMATDESCRIPTOR));
-
- pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
- pfd.nVersion = 1;
- pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_DRAW_TO_WINDOW;
- pfd.iPixelType = PFD_TYPE_RGBA;
- pfd.cColorBits = 24;
- pfd.cDepthBits = 24;
- pfd.iLayerType = PFD_MAIN_PLANE;
-
- int nPixelFormat = OpenGLChoosePixelFormat(m_pDC->m_hDC, &pfd);
- if (nPixelFormat == 0)
- return -1 ;
-
- if (!OpenGLSetPixelFormat(m_pDC->m_hDC, nPixelFormat, &pfd))
- return -1 ;
-
- m_pPal = new CPalette;
-
- if (CreateRGBPalette(m_pDC->m_hDC, &m_pPal))
- {
- m_pDC->SelectPalette(m_pPal, FALSE);
- m_pDC->RealizePalette();
- }
- else
- {
- delete m_pPal;
- m_pPal = NULL;
- }
-
- // Create a rendering context.
- m_hrc = pfnwglCreateContext(m_pDC->m_hDC);
- if (!m_hrc)
- return -1;
-
- HDC oldDC = pfnwglGetCurrentDC();
- HGLRC oldRC = pfnwglGetCurrentContext();
- pfnwglShareLists(oldRC, m_hrc);
- pfnwglMakeCurrent (m_pDC->m_hDC, m_hrc);
-
- pfnwglMakeCurrent (oldDC, oldRC);
-
- return 0;
-}
-
-BOOL CMinifigWnd::OnEraseBkgnd(CDC* /*pDC*/)
-{
- return TRUE;
-}
-
-void CMinifigWnd::OnPaint()
-{
- CPaintDC dc(this); // device context for painting
-
- DrawScene();
-}
-
-void CMinifigWnd::OnDestroy()
-{
- if (m_pPal)
- {
- CPalette palDefault;
- palDefault.CreateStockObject(DEFAULT_PALETTE);
- m_pDC->SelectPalette(&palDefault, FALSE);
- delete m_pPal;
- }
-
- if (m_hrc)
- pfnwglDeleteContext(m_hrc);
- if (m_pDC)
- delete m_pDC;
-
- CWnd::OnDestroy();
-}
-
-void CMinifigWnd::DrawScene()
-{
- if (m_pPal)
- {
- m_pDC->SelectPalette(m_pPal, FALSE);
- m_pDC->RealizePalette();
- }
-
- HDC oldDC = pfnwglGetCurrentDC();
- HGLRC oldRC = pfnwglGetCurrentContext();
- pfnwglMakeCurrent (m_pDC->m_hDC, m_hrc);
-
- RECT rc;
- GetClientRect (&rc);
- m_pFig->Resize (rc.right, rc.bottom);
- m_pFig->Redraw ();
-
- OpenGLSwapBuffers (m_pDC->m_hDC);
- pfnwglMakeCurrent (oldDC, oldRC);
-}
diff --git a/win/Mfwnd.h b/win/Mfwnd.h
deleted file mode 100644
index e14245a..0000000
--- a/win/Mfwnd.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef __MFWND_H__
-#define __MFWND_H__
-
-// MFWind.h : header file
-//
-
-//#include "system.h"
-class MinifigWizard;
-
-/////////////////////////////////////////////////////////////////////////////
-// CMinifigWnd window
-
-class CMinifigWnd : public CWnd
-{
-// Construction
-public:
- CMinifigWnd();
-
-// Attributes
-protected:
- HGLRC m_hrc;
- CClientDC* m_pDC;
- CPalette* m_pPal;
-
-// Operations
-public:
- void DrawScene();
- int InitGL();
- MinifigWizard* m_pFig;
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMinifigWnd)
- //}}AFX_VIRTUAL
-
-// Implementation
-public:
- virtual ~CMinifigWnd();
-
- // Generated message map functions
-protected:
- //{{AFX_MSG(CMinifigWnd)
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnPaint();
- afx_msg void OnDestroy();
- //}}AFX_MSG
-
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // __MFWND_H__