00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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