#pragma once #include "DXBuffer.h" #include "Mat4.h" #include "Vec2.h" namespace Framework { class NativeWindow; class Image; class Texture; class Cam3D; class Model3DList; class Model3DData; enum GraphicApiType; enum TextureDirection; struct DiffuseLight { Vec3 direction; Vec3 color; }; struct PointLight { Vec3 position; Vec3 color; float radius; }; class GraphicsApi : public virtual ReferenceCounter { protected: GraphicApiType typ; NativeWindow* fenster; Vec2 backBufferSize; Model3DList* modelList; int nextModelId; ReadWriteLock rwLock; bool fullScreen; public: DLLEXPORT GraphicsApi(GraphicApiType typ); DLLEXPORT virtual ~GraphicsApi(); DLLEXPORT virtual void initialize( NativeWindow* fenster, Vec2 backBufferSize, bool fullScreen); DLLEXPORT virtual void beginFrame( bool fill2D = 0, bool fill3D = 0, int fillColor = 0); DLLEXPORT virtual void renderKamera(Cam3D* zKamera); DLLEXPORT virtual void renderKamera(Cam3D* zKamera, Texture* zTarget); DLLEXPORT virtual void presentFrame() = 0; DLLEXPORT virtual Texture* createOrGetTexture(const char* name, Image* b = 0, TextureDirection dir = (TextureDirection)0); DLLEXPORT GraphicApiType getTyp() const; DLLEXPORT Vec2 getBackBufferSize() const; DLLEXPORT bool isFullScreen() const; DLLEXPORT virtual Image* zUIRenderImage() const = 0; //! returns the specified model without increased reference counter DLLEXPORT virtual Model3DData* zModel(const char* name); //! returns the specified model with increased reference counter DLLEXPORT virtual Model3DData* getModel(const char* name); //! creates a new empty Model3DData object if the model does not exist //! yet DLLEXPORT virtual Model3DData* createModel(const char* name); //! check if a model exists DLLEXPORT virtual bool hasModel(const char* name); //! creates a StructuredBuffer that is stored in the GPU memory and can //! be used as a shader resource //! \param eSize the size of one element of the buffer in bytes DLLEXPORT virtual DXBuffer* createStructuredBuffer(int eSize) = 0; DLLEXPORT virtual bool renderGuiBefore3D() const; }; } // namespace Framework