選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

77 行
1.6 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://www.wtfpl.net/ for more details.
  9. //
  10. #pragma once
  11. //
  12. // The Scene class
  13. // ---------------
  14. //
  15. #include <stdint.h>
  16. #include "tileset.h"
  17. #include "light.h"
  18. #include "camera.h"
  19. #include "mesh/primitive.h"
  20. #define LOL_MAX_LIGHT_COUNT 8
  21. namespace lol
  22. {
  23. class SceneData;
  24. class Scene
  25. {
  26. friend class Video;
  27. private:
  28. Scene(ivec2 size);
  29. ~Scene();
  30. public:
  31. Camera *GetCamera(int cam_idx=-1);
  32. int PushCamera(Camera *cam);
  33. void PopCamera(Camera *cam);
  34. void SetTileCam(int cam_idx);
  35. void Reset();
  36. void RenderPrimitives();
  37. void RenderTiles();
  38. void RenderLines(float seconds);
  39. /* New scenegraph */
  40. void AddPrimitive(Mesh const &mesh, mat4 const &matrix);
  41. /* FIXME: this should be deprecated -- it doesn't really match
  42. * the architecture we want to build */
  43. void AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale, float angle);
  44. void SetLineTime(float new_time=-1.f);
  45. void SetLineMask(int new_mask=0xFFFFFFFF);
  46. void SetLineSegmentSize(float new_segment_size=100000.f);
  47. float GetLineSegmentSize();
  48. void SetLineColor(vec4 new_color=vec4(1.f));
  49. vec4 GetLineColor();
  50. void AddLine(vec3 a, vec3 b, vec4 color);
  51. void AddLight(Light *light);
  52. array<Light *> const &GetLights() const;
  53. private:
  54. SceneData *data;
  55. };
  56. extern Scene *g_scene;
  57. } /* namespace lol */