Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

IVideoDevice.h

Go to the documentation of this file.
00001 /*
00002 
00003 AmnesiaEngine
00004 Copyright (c) 2006 John DiSanti.
00005 
00006 Permission is hereby granted, free of charge,
00007 to any person obtaining a copy of this software and associated
00008 documentation files (the "Software"), to deal in the Software
00009 without restriction, including without limitation the rights to
00010 use, copy, modify, merge, publish, distribute, sublicense,
00011 and/or sell copies of the Software, and to permit persons to
00012 whom the Software is furnished to do so, subject to the following
00013 conditions:
00014 
00015 The above copyright notice and this permission notice shall be included
00016 in all copies or substantial portions of the Software.
00017 
00018 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
00019 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
00020 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
00021 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00022 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00023 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00024 
00025 */
00026 
00027 #ifndef AMN_IVIDEODEVICE_H
00028 #define AMN_IVIDEODEVICE_H
00029 
00030 #include <string>
00031 #include "IReference.h"
00032 #include "SVertex3d.h"
00033 #include "SMaterial.h"
00034 #include "IMatrix4x4.h"
00035 #include "IArray.h"
00036 
00037 namespace amn
00038 {
00039         class IEngine;
00040         enum E_VD_TYPE
00041         {
00043                 EVDT_NULL = 0,
00045                 EVDT_OPENGL,
00047                 EVDT_DIRECTX
00048         };
00049 
00050         enum E_TRANSFORM_MATRIX
00051         {
00052                 ETM_WORLD,
00053                 ETM_PROJECTION
00054         };
00055 
00056         typedef struct
00057         {
00058                 unsigned short  Width, Height;
00059                 unsigned char   Bits;
00060 
00061                 bool            FullScreen;
00062                 bool            AntiAlias;
00063                 bool            StencilBuffer;
00064                 bool            VSync;
00065 
00066                 std::string     WindowTitle;
00067                 IEngine*        Engine;
00068         }SVideoDeviceCreationParameters;
00069 
00070         typedef struct
00071         {
00072                 short width, height;
00073         }SDimension2d;
00074 
00076         class IVideoDevice : public IReference
00077         {
00078         public:
00080                 IVideoDevice(SVideoDeviceCreationParameters* params) {}
00082                 virtual ~IVideoDevice() {}
00083 
00085                 virtual IEngine* getEngine() = 0;
00086 
00088                 virtual E_VD_TYPE getVideoDeviceType() = 0;
00089 
00091                 virtual void setClearColor(SColor& color) = 0;
00092 
00094                 virtual bool update() = 0;
00096                 virtual void beginRender() = 0;
00098                 virtual void endRender() = 0;
00099 
00103                 virtual void setMaterial(SMaterial* material) = 0;
00104 
00111                 virtual void drawIndexedTriangleList(unsigned int* indices, unsigned int indexCount, 
00112                         SVertex3d* vertices, unsigned int vertexCount) = 0;
00113 
00120                 virtual void drawIndexedTriangleList(unsigned int* indices, unsigned int indexCount, 
00121                         SVertex3dMUV* vertices, unsigned int vertexCount) = 0;
00122 
00129                 virtual void drawIndexedQuadList(unsigned int* indices, unsigned int indexCount,
00130                         SVertex3d* vertices, unsigned int vertexCount) = 0;
00131 
00133                 virtual void enableRender2D() = 0;
00135                 virtual void disableRender2D() = 0;
00136 
00138                 virtual void setTransform(IMatrix4x4& matrix, E_TRANSFORM_MATRIX matType) = 0;
00139 
00141                 virtual void resetTransform(E_TRANSFORM_MATRIX matType) = 0;
00142 
00144                 virtual void pushTransform(E_TRANSFORM_MATRIX matType) = 0;
00145 
00147                 virtual void popTransform(E_TRANSFORM_MATRIX matType) = 0;
00148 
00150                 virtual SDimension2d& getViewportSize() = 0;
00151 
00152         protected:
00153                 IEngine* engine;
00154                 SDimension2d viewport;
00155                 SColor clearColor;
00156         };
00157 };
00158 
00159 #endif//AMN_IVIDEODEVICE_H
00160 
00161 /* End of File */

Generated on Wed Feb 1 22:23:26 2006 for AmnesiaEngine by  doxygen 1.4.2