| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #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;
- struct DiffuseLight
- {
- Vec3<float> direction;
- Vec3<float> color;
- };
- struct PointLight
- {
- Vec3<float> position;
- Vec3<float> color;
- float radius;
- };
- class GraphicsApi : public virtual ReferenceCounter
- {
- protected:
- GraphicApiType typ;
- NativeWindow* fenster;
- Vec2<int> backBufferSize;
- Model3DList* modelList;
- int nextModelId;
- ReadWriteLock rwLock;
- bool fullScreen;
- public:
- DLLEXPORT GraphicsApi(GraphicApiType typ);
- DLLEXPORT virtual ~GraphicsApi();
- DLLEXPORT virtual void initialize(
- NativeWindow* fenster, Vec2<int> 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);
- DLLEXPORT GraphicApiType getTyp() const;
- DLLEXPORT Vec2<int> 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;
- };
- } // namespace Framework
|