# Rewrite 5
- Move Libraries Source into pd directory and give them all their own CMakeLists.txt - Partial rewrite core (color, autogenerated vec), lithium (now uses UNIQUE PTR for Commands), UI7 - Use MenuV2 as new standart in UI7 - Implementz ViewPort Pre alpha to UI7 - Add Line Drawing to DrawList (not Working) - Implement a Complete new drievrs API (static Drivers) - NO SUPPORT FOR SHARED LIBRARY BUILDS IN VERSION 5 YET - Add Tools to Autogenerate Headers and Stuff
This commit is contained in:
		
							
								
								
									
										43
									
								
								include/pd/lithium/renderer.hpp
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										43
									
								
								include/pd/lithium/renderer.hpp
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							| @@ -24,37 +24,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||||
| SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| #include <pd/lithium/backend.hpp> | ||||
| #include <pd/lithium/drawlist.hpp> | ||||
| #include <pd/lithium/font.hpp> | ||||
| #include <pd/drivers/drivers.hpp> | ||||
| #include <pd/lithium/pd_p_api.hpp> | ||||
| #include <pd/lithium/rect.hpp> | ||||
|  | ||||
| namespace PD { | ||||
| namespace LI { | ||||
| class PD_LITHIUM_API Renderer : public SmartCtor<Renderer> { | ||||
| namespace Li { | ||||
| /** | ||||
|  * Static Class Render Setup Functions | ||||
|  */ | ||||
| class PD_LITHIUM_API Renderer { | ||||
|  public: | ||||
|   Renderer(Backend::Ref backend); | ||||
|   Renderer() = default; | ||||
|   ~Renderer() = default; | ||||
|  | ||||
|   void Render(); | ||||
|  | ||||
|   // SECTION: ADVANCED API | ||||
|  | ||||
|   void AddCommand(Command::Ref v) { DrawList.Add(v); } | ||||
|   void RegisterDrawList(DrawList::Ref list) { pDrawLists.Add(list); } | ||||
|   Command::Ref PreGenerateCmd(); | ||||
|  | ||||
|   // SECTION: Open Command and Object creation API | ||||
|   static void RotateCorner(fvec2& pos, float sinus, float cosinus); | ||||
|   static void RotateCorner(fvec2& pos, float s, float c); | ||||
|   static Rect PrimRect(const fvec2& pos, const fvec2& size, float angle = 0.f); | ||||
|   static Rect PrimLine(const fvec2& a, const fvec2& b, int thickness = 1); | ||||
|   static void CmdQuad(Command::Ref cmd, const Rect& quad, const Rect& uv, | ||||
|   static void CmdQuad(Command* cmd, const Rect& quad, const Rect& uv, | ||||
|                       u32 color); | ||||
|   static void CmdTriangle(Command::Ref cmd, const fvec2 a, const fvec2 b, | ||||
|   static void CmdTriangle(Command* cmd, const fvec2 a, const fvec2 b, | ||||
|                           const fvec2 c, u32 clr); | ||||
|   static void CmdPolyLine(const Vec<fvec2>& points, u32 clr, u32 flags = 0, | ||||
|                           int thickness = 1); | ||||
|   static void CmdConvexPolyFilled(Command::Ref cmd, const Vec<fvec2>& points, | ||||
|   static void CmdConvexPolyFilled(Command* cmd, const Vec<fvec2>& points, | ||||
|                                   u32 clr, Texture::Ref tex); | ||||
|  | ||||
|   // SECTION: InBounds Checks | ||||
| @@ -63,17 +57,6 @@ class PD_LITHIUM_API Renderer : public SmartCtor<Renderer> { | ||||
|   static bool InBox(const fvec2& pos, const fvec4& area); | ||||
|   static bool InBox(const fvec2& a, const fvec2& b, const fvec2& c, | ||||
|                     const fvec4& area); | ||||
|  | ||||
|   // SECTION: Data // | ||||
|  | ||||
|   Texture::Ref WhitePixel = nullptr; | ||||
|   Backend::Ref pBackend = nullptr; | ||||
|   Texture::Ref CurrentTex = nullptr; | ||||
|   int Layer = 0; | ||||
|  | ||||
|  private: | ||||
|   PD::Vec<Command::Ref> DrawList; | ||||
|   PD::Vec<DrawList::Ref> pDrawLists; | ||||
| }; | ||||
| }  // namespace LI | ||||
| }  // namespace Li | ||||
| }  // namespace PD | ||||
		Reference in New Issue
	
	Block a user