3dLightList.cpp
资源名称:gloop.zip [点击查看]
上传用户:shxiangxiu
上传日期:2007-01-03
资源大小:1101k
文件大小:2k
源码类别:
OpenGL
开发平台:
Visual C++
- /////////////////////////////////////////////////////////////////////////////
- // 3dLightList.cpp : implementation file
- //
- // glOOP (OpenGL Object Oriented Programming library)
- // Copyright (c) Craig Fahrnbach 1997, 1998
- //
- // OpenGL is a registered trademark of Silicon Graphics
- //
- //
- // This program is provided for educational and personal use only and
- // is provided without guarantee or warrantee expressed or implied.
- //
- // Commercial use is strickly prohibited without written permission
- // from ImageWare Development.
- //
- // This program is -not- in the public domain.
- //
- /////////////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "glOOP.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- //////////////////////////////////////////////////////////////////
- // C3dLightList
- //IMPLEMENT_DYNAMIC(C3dLightList, CObList)
- /////////////////////////////////////////////////////////////////////////////
- // C3dLightList construction
- C3dLightList::C3dLightList()
- {
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
- }
- /////////////////////////////////////////////////////////////////////////////
- // C3dLightList Destructor
- C3dLightList::~C3dLightList()
- {
- }
- /////////////////////////////////////////////////////////////////////////////
- // C3dLightList commands
- void C3dLightList::Remove(C3dObject* pLight)
- {
- if (!pLight) return;
- POSITION pos = CObList::Find(pLight);
- if (pos) {
- RemoveAt(pos);
- }
- }
- void C3dLightList::Delete(C3dObject* pLight)
- {
- if (!pLight) return;
- Remove(pLight);
- }
- void C3dLightList::DeleteAll()
- {
- while (!IsEmpty())
- C3dObject* pLight = (C3dObject*) RemoveHead();
- }
- #if 0 // not used
- // See if the list contains a shape with the same frame and
- // visual attachments
- C3dObject* C3dLightList::Find(C3dObject* pLight)
- {
- if (!pLight) return NULL;
- IDirect3DRMFrame* pIFrame = pLight->GetInterface();
- IDirect3DRMVisual* pIVisual = pLight->GetVisual();
- C3dObject* pListEntry = NULL;
- // walk the list
- POSITION pos = GetHeadPosition();
- while (pos) {
- pListEntry = GetNext(pos);
- if ((pListEntry->GetInterface() == pIFrame)
- && (pListEntry->GetVisual() == pIVisual)) {
- return pListEntry;
- }
- }
- return NULL; // end of list
- }
- #endif