Simple game engine with complete export to scripting language
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

66 lines
1.4 KiB

  1. #ifndef BLUECORE_RENDERDEVICE_H
  2. #define BLUECORE_RENDERDEVICE_H
  3. #include "RenderWindow.h"
  4. #include "Camera.h"
  5. #include "Material.h"
  6. #include "Utilities/Buffer.h"
  7. #include "Utilities/Referenced.h"
  8. #include "Utilities/sigslot.h"
  9. namespace BlueCore
  10. {
  11. class RenderDevice : public Referenced, public sigslot::has_slots<>
  12. {
  13. private:
  14. int _ViewportWidth, _ViewportHeight;
  15. void WindowResizeSlot(int width, int height);
  16. void WindowCloseSlot();
  17. ref_ptr<RenderWindow> _RenderWindow;
  18. ref_ptr<Camera> _Camera;
  19. unsigned int _ActiveTextures;
  20. public:
  21. RenderDevice(RenderWindow* renderWindow);
  22. ~RenderDevice();
  23. int getViewportWidth();
  24. int getViewportHeight();
  25. void begin2D();
  26. void end2D();
  27. void begin3D(Camera *);
  28. void end3D();
  29. void clear();
  30. void swap();
  31. void setAmbientLight(float r, float g, float b);
  32. void setMaterial(Material *);
  33. void setTexture(unsigned int unit, Texture* texture, bool last = false);
  34. void setShaderProgram(ShaderProgram shader_program);
  35. void setTexture(ShaderProgram shader_program, unsigned int texture,
  36. const std::string &name);
  37. void pushAbsoluteTransformation(const Vector3&, const Quaternion&);
  38. void pushTransformation(const Vector3&, const Quaternion&);
  39. void popTransformation();
  40. void setupProjectionMatrix();
  41. void setupViewMatrix();
  42. sigslot::signal0<> DeviceShutdownSignal;
  43. //Buffer<ShadowFace> &_ShadowFaces;
  44. };
  45. } // namespaced BlueCore
  46. #endif // BLUECORE_RENDERDEVICE_H