# Changes -> 0.5.1
- 3ds - Remove Gfx values that are present in Backend Tamplate - Move to default Palladium Namespace - Set the Input Flags - Desktop - Move to PD Namespace - Comment out old keyboard stuff - HidDriver needs a rewrite but is functional enough - Core - Add u128 class (only used in input driver so far - Drivers (Core) - Move Gfx to PD namespace - Move Vertex/Index Pos and Projection Mtx to Gfx template - Add Keyboard support with u128 to Hid - Add a Update func if no hiddriver is specified (to prevent crashes when requestign inputs) - Image - Add RGBA -> BGRA support (used in windows bitmaps iirc) - Lithium - Add Vertex/Index counters to drawlist - Add a LoadTTF from Mem func and let the loadfile func use PD::IO::LoadFile2Mem (looks cleaner) - Add LoadDefaultFont (which loads one of the integrated fonts if the PD_LI_INCLUDE_FONTS flag was passed on palaldium build) !!! Note that there are no fonts integrated yet due to i dont know how to handle licensing... - UI7 - Add MouseLeft support to Input handler - Use xy coords of the Viewport to create Menus inside it - Get num of Vertices/Indices out of FinalDrawList - Add some Palladium Info to metrics Menu - Readd Compiler string - pdfm - New tool that creates fonts.cpp/fonts.hpp
This commit is contained in:
		| @@ -33,7 +33,6 @@ SOFTWARE. | ||||
| #include <pd/lithium/lithium.hpp> | ||||
|  | ||||
| namespace PD { | ||||
| namespace Li { | ||||
| class GfxGL2 : public GfxDriver { | ||||
|  public: | ||||
|   GfxGL2() : GfxDriver("OpenGL2") {} | ||||
| @@ -53,18 +52,11 @@ class GfxGL2 : public GfxDriver { | ||||
|       PD::Li::Texture::Filter filter = | ||||
|           PD::Li::Texture::Filter::LINEAR) override; | ||||
|  | ||||
|   PD::Vec<Vertex> VertexBuffer; | ||||
|   PD::Vec<Li::Vertex> VertexBuffer; | ||||
|   PD::Vec<PD::u16> IndexBuffer; | ||||
|   size_t CurrentVertex = 0; | ||||
|   size_t CurrentIndex = 0; | ||||
|   GLuint Shader; | ||||
|   GLuint pLocProjection; | ||||
|   GLuint pLocTex; | ||||
|   Mat4 Projection; | ||||
|   GLuint VBO, IBO; | ||||
|   // Stats oder so IDNK zu lange her | ||||
|   PD::u32 NumVtx; | ||||
|   PD::u32 NumIdx; | ||||
| }; | ||||
| }  // namespace Li | ||||
| }  // namespace PD | ||||
| @@ -25,7 +25,6 @@ SOFTWARE. | ||||
| #include <pd-desktop/bknd-gfx.hpp> | ||||
|  | ||||
| namespace PD { | ||||
| namespace Li { | ||||
| const char* vertex_shader = R"( | ||||
|   #version 120 | ||||
|    | ||||
| @@ -161,13 +160,11 @@ void GfxGL2::NewFrame() { | ||||
|   glUniformMatrix4fv(pLocProjection, 1, GL_FALSE, Projection.m.data()); | ||||
|   glEnable(GL_BLEND); | ||||
|   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | ||||
|   CurrentIndex = 0; | ||||
|   CurrentVertex = 0; | ||||
|   FrameCounter++; | ||||
|   VertexCounter = NumVtx; | ||||
|   IndexCounter = NumIdx; | ||||
|   NumVtx = 0; | ||||
|   NumIdx = 0; | ||||
|   VertexCounter = CurrentVertex; | ||||
|   IndexCounter = CurrentIndex; | ||||
|   CurrentVertex = 0; | ||||
|   CurrentIndex = 0; | ||||
| } | ||||
|  | ||||
| void GfxGL2::BindTex(PD::Li::TexAddress addr) { | ||||
| @@ -194,11 +191,9 @@ void GfxGL2::RenderDrawData(const std::vector<PD::Li::Command::Ref>& Commands) { | ||||
|            Commands[index]->ScissorRect == ScissorRect) { | ||||
|       auto c = Commands[index].get(); | ||||
|       for (size_t i = 0; i < c->IndexBuffer.Size(); i++) { | ||||
|         NumIdx++; | ||||
|         IndexBuffer[CurrentIndex++] = CurrentVertex + c->IndexBuffer.At(i); | ||||
|       } | ||||
|       for (size_t i = 0; i < c->VertexBuffer.Size(); i++) { | ||||
|         NumVtx++; | ||||
|         VertexBuffer[CurrentVertex++] = c->VertexBuffer.At(i); | ||||
|       } | ||||
|       index++; | ||||
| @@ -258,5 +253,4 @@ PD::Li::Texture::Ref GfxGL2::LoadTex(const std::vector<PD::u8>& pixels, int w, | ||||
|   auto res = PD::Li::Texture::New(texID, PD::ivec2(w, h)); | ||||
|   return res; | ||||
| } | ||||
| }  // namespace Li | ||||
| }  // namespace PD | ||||
| @@ -40,7 +40,7 @@ HidGLFW::HidGLFW(GLFWwindow* win) : HidDriver("HidGLFW") { | ||||
|   Flags |= Flags_HasKeyboard; | ||||
|   Flags |= Flags_HasMouse; | ||||
|   pBinds[GLFW_MOUSE_BUTTON_LEFT] = Touch; | ||||
|   pBinds[GLFW_KEY_F3] = Kb_3; | ||||
|   /*pBinds[GLFW_KEY_F3] = Kb_3; | ||||
|   pBinds[GLFW_KEY_ESCAPE] = Kb_Escape; | ||||
|   pBinds[GLFW_KEY_F11] = Kb_F11; | ||||
|   pBinds[GLFW_KEY_ESCAPE] = Kb_Escape; | ||||
| @@ -94,7 +94,7 @@ HidGLFW::HidGLFW(GLFWwindow* win) : HidDriver("HidGLFW") { | ||||
|   pBinds[GLFW_KEY_9] = Kb_9; | ||||
|   pBinds[GLFW_KEY_0] = Kb_0; | ||||
|   pBinds[GLFW_KEY_BACKSPACE] = Kb_Backspace; | ||||
|   pBinds[GLFW_KEY_ENTER] = Kb_Enter; | ||||
|   pBinds[GLFW_KEY_ENTER] = Kb_Enter;*/ | ||||
| } | ||||
|  | ||||
| void HidGLFW::Update() { | ||||
| @@ -108,7 +108,7 @@ void HidGLFW::Update() { | ||||
|     } | ||||
|   } | ||||
|   // Keyboard Logic | ||||
|   for (auto& it : pBinds) { | ||||
|   /*for (auto& it : pBinds) { | ||||
|     int kbstate = glfwGetKey(Window, it.first); | ||||
|     if (kbstate == GLFW_PRESS) { | ||||
|       if (PrevStates[it.first] == GLFW_RELEASE) { | ||||
| @@ -119,7 +119,7 @@ void HidGLFW::Update() { | ||||
|       KbKeyEvents[0][it.second] = Event_Up; | ||||
|     } | ||||
|     PrevStates[it.first] = kbstate; | ||||
|   } | ||||
|   }*/ | ||||
|   // Mouse Logic (Todo: Support all mouse buttons) | ||||
|   int state = glfwGetMouseButton(Window, GLFW_MOUSE_BUTTON_LEFT); | ||||
|   if (state == GLFW_PRESS) { | ||||
| @@ -155,12 +155,12 @@ void HidGLFW::HandleTextOps() { | ||||
|   if (!pText) { | ||||
|     return; | ||||
|   } | ||||
|   if (pTimedHeld(Kb_Backspace)) { | ||||
|   /*if (pTimedHeld(Kb_Backspace)) { | ||||
|     if (!pText->empty()) { | ||||
|       pText->pop_back(); | ||||
|     } | ||||
|   } else if (pTimedHeld(Kb_Enter)) { | ||||
|     *pText += '\n'; | ||||
|   } | ||||
|   }*/ | ||||
| } | ||||
| }  // namespace PD | ||||
| @@ -37,7 +37,7 @@ void Init(void* data) { | ||||
|   // Dekstop Init Stage | ||||
|   // First use default OS Driver | ||||
|   PD::OS::Init(); | ||||
|   PD::Li::Gfx::Init(PD::Li::GfxGL2::New()); | ||||
|   PD::Gfx::Init(PD::GfxGL2::New()); | ||||
|   PD::Hid::Init(PD::HidGLFW::New(reinterpret_cast<GLFWwindow*>(data))); | ||||
| } | ||||
| }  // namespace PD | ||||
		Reference in New Issue
	
	Block a user