00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://www.ogre3d.org/ 00006 00007 Copyright © 2000-2002 The OGRE Team 00008 Also see acknowledgements in Readme.html 00009 00010 This program is free software; you can redistribute it and/or modify it under 00011 the terms of the GNU Lesser General Public License as published by the Free Software 00012 Foundation; either version 2 of the License, or (at your option) any later 00013 version. 00014 00015 This program is distributed in the hope that it will be useful, but WITHOUT 00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License along with 00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00022 http://www.gnu.org/copyleft/lesser.txt. 00023 ----------------------------------------------------------------------------- 00024 */ 00025 #include "OgreD3D7RenderSystem.h" 00026 #include "OgreDDVideoMode.h" 00027 00028 namespace Ogre { 00029 // Constructors 00030 DDVideoMode::DDVideoMode() 00031 { 00032 // Nothing 00033 } 00034 00035 // Copy Constructor 00036 DDVideoMode::DDVideoMode(const DDVideoMode &ob) 00037 { 00038 mWidth = ob.mWidth; 00039 mHeight = ob.mHeight; 00040 mColourDepth = ob.mColourDepth; 00041 mDDSurfaceDesc = ob.mDDSurfaceDesc; 00042 } 00043 00044 // Enum constructor 00045 DDVideoMode::DDVideoMode(LPDDSURFACEDESC2 lpDDSD2) 00046 { 00047 // Copy surface desc 00048 memcpy(&mDDSurfaceDesc, lpDDSD2, sizeof(DDSURFACEDESC2)); 00049 00050 // Determine basic information 00051 mWidth = mDDSurfaceDesc.dwWidth; 00052 mHeight = mDDSurfaceDesc.dwHeight; 00053 mColourDepth = mDDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount; 00054 00055 00056 } 00057 DDVideoMode DDVideoMode::operator=(const DDVideoMode &orig) 00058 { 00059 00060 mWidth = orig.mWidth; 00061 mHeight = orig.mHeight; 00062 mColourDepth = orig.mColourDepth; 00063 mDDSurfaceDesc = orig.mDDSurfaceDesc; 00064 00065 00066 return *this; 00067 00068 } 00069 00070 String DDVideoMode::Description(void) 00071 { 00072 00073 char tmp[128]; 00074 char *final; 00075 00076 sprintf(tmp, "%d x %d @ %d-bit colour", mWidth, mHeight, mColourDepth); 00077 return String(tmp); 00078 00079 /* final = (char*)malloc(sizeof(char)*(strlen(tmp)+1)); 00080 00081 strcpy(final, tmp);*/ 00082 00083 return final; 00084 00085 } 00086 }
Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:10:09 2004