DX9GraphicsApi.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include "GraphicsApi.h"
  3. //! DirectX 9 Types
  4. struct IDirect3D9;
  5. struct IDirect3DDevice9;
  6. struct IDirect3DSurface9;
  7. struct _D3DLOCKED_RECT;
  8. struct tagRECT;
  9. namespace Framework
  10. {
  11. class NativeWindow; //! NativeWindow.h
  12. class Image; //! Image.h
  13. class Cam3D; //! Camera3D.h
  14. class Texture; //! Texture.h
  15. class Model3DData; //! Model3D.h
  16. //! A graphics API that uses DirectX 9. Only supports 2D rendering
  17. class DirectX9 : public GraphicsApi
  18. {
  19. private:
  20. IDirect3D9* pDirect3D;
  21. IDirect3DDevice9* pDevice;
  22. IDirect3DSurface9* pBackBuffer;
  23. _D3DLOCKED_RECT* backRect;
  24. Image* uiImage;
  25. public:
  26. DLLEXPORT DirectX9();
  27. DLLEXPORT ~DirectX9();
  28. DLLEXPORT void initialize(NativeWindow* fenster,
  29. Vec2<int> backBufferSize,
  30. bool fullScreen) override;
  31. DLLEXPORT void beginFrame(
  32. bool fill2D, bool fill3D, int fillColor) override;
  33. DLLEXPORT void renderKamera(Cam3D* zKamera) override;
  34. DLLEXPORT void presentFrame() override;
  35. DLLEXPORT Texture* createOrGetTexture(
  36. const char* name, Image* b, TextureDirection dir) override;
  37. DLLEXPORT Image* zUIRenderImage() const override;
  38. DLLEXPORT virtual DXBuffer* createStructuredBuffer(int eSize) override;
  39. };
  40. } // namespace Framework