Skip to content

Conversation

@ASchuberth
Copy link
Owner

Added Commands and Observer/Subject patterns for user input and rendering entities

ASchuberth and others added 15 commits May 12, 2025 12:35
- escapePress() is set to the disable tools command
- Added SketchDisableToolsCommand to sketchcommands
- Added Keyboard class
- removed sketch_mode_callback(), sketch_select_addPoint(), and sketch_select_removePoint()
- Changed mBuffers to take int key
- Changed updateBuffer(), deleteBuffer(), and createDeviceBuffer() to take int id instead of BufferName
- render(), renderSketchGrid(), renderSketchPoints(), renderSketchNotes(), renderSketchPointTool() have been commented out
-- onNotify() takes care of rendering for now
- CADRender inherits from Observer
- Model inherits from Model
- Sketch::notify() calls Render->onNotify()
- Added Observer and Subject classes
- Added RenderItems struct
- Model now has RenderItems member variable
- New Sketch in gui now sets Render as the observer of the new sketch
- Added leftMouseHold and leftMouseRelease() functions to Mouse
-  Added SketchMoveCommand, SketchSelectPointCommand, SketchDeselectPointCommand, and SketchDeleteCommand
- Implemented these commands in the keyboard and mouse and in callbacks.cpp
- Added Middle mouse click and release functions to Mouse
- Added CameraPanCommand and CameraUnsetPanCommand to cameracommands
- Replaced Render.Cam with middle mouse click and release in callbacks
- Added rendercommands.hpp/cpp
- Added Input class
- Removed Keyboard and Mouse from CADRender
- Added Input to Cadera
- Set Cadera::input as user pointer for GLFW3
- Restructured includes so commands have access to CADRender
- Commands now get set to Cadera::input keyboard and mouse
- Disabled framebuffer resize and left CTRL callbacks for now
- Added LCtrlRelease() to Keyboard
- Added framebufferresizeSlot and setter to Input
- Fixed RenderFramebufferResizeCommand in rendercommands
- Added Commands to Cadera: SketchSelectSet/UnsetCtrlCmds and RenderFramebufferResizeCmd
- Setup added commands in cadera.cpp
- All 3 commands are now executed in callbacks
- Cadera now has Selector as a member variable called mSelector
- Changed Cadera::Render to mRender
- Changed Cadera::Sketch to mSketch
- Removed render functions from CADRender, render(), renderSketchGrid(), renderSketchPoints(), renderSketchPointTool()
- callbacks.hpp is now included in cadera.hpp and not cadrender.hpp
- Removed normalPos local variable in Camera::zoom as it is not needed or used
- Removed Render.Sel from gui.cpp, which now points to the parameter Selector
- Moved selection to render/
- Made renderlib target sketchlib and textlib publicly
- CaderaApp target no longer targets sketchlib and textlib
- Removed unneeded include of rendercommands.hpp in cadera.hpp

- Fixed issue where dragging imgui window would move sketch points at the same time
- Added Test Fixture TextRenderTest
- Added 3 tests clearTexts, generateQuads, and generateIndices that use TextRenderTest

- Made constructor of TextRender initialize variables instead of copy assignment
- Made TextRender::setCursorPos() to private
- Text struct value initializes members
- Added inputlib
- CaderaApp now links to inputlib
- inputlib now links to renderlib
- Added test_input and 2 tests: inputFramebufferResized_Throw and inputFramebufferResized_NoThrow
-  TextRenderTest::generateQuads and generateIndices now tests both 1 and 2 characters
- updated cadrender::createCommandBuffers()
- added vector of txt::Text to RenderItems
- Sketch::notify() now updates mRenderItems::texts
- Added constructor to cadrender
- Added setupDebugUtils(), cmd_being_label(), cmd_end_label(), setObjectName() to cadrender
- Renamed Pipelines to pipelines
- For destroying device, surfaces, and instance, device.destroy() and instance.destroy() are used instead of vkDestroy.. functions
- Close csv file in TextRender::loadFont()
- Added test_render
- Selector is now a subject
- Render observes Selector
- Added render() to CADRender and is called in the mainloop()
- Selector notifies for sketch move, select, deselect, and delete commands
- CADRender now keeps a map of each RenderData it observes
CADRender when notified adds/updates the renderData for the subject.
- CADRender iterates over RenderData in the command buffers
- Added constant number_of_buffers_per_model
- Renamed RenderItems to RenderData
- Model id now starts at 1, 0 is reserved for Selector
- Sketch points now dynamically change color when changed in debug menu
- Moved Commands to be in Input class
- Added setSketch/Camera/RenderCommands() to Input
-  Added setMouse() and setKeyboard()
- Added sketchMode to Input
- Removed SketchEvents() from Cadera
@ASchuberth ASchuberth added this to the 0.1.2 milestone Nov 24, 2025
@ASchuberth ASchuberth self-assigned this Nov 24, 2025
@ASchuberth ASchuberth added the enhancement New feature or request label Nov 24, 2025
@ASchuberth
Copy link
Owner Author

Build failures left for future fixes.

@ASchuberth ASchuberth closed this Nov 24, 2025
@ASchuberth ASchuberth reopened this Nov 24, 2025
@ASchuberth ASchuberth merged commit e771fbf into develop Nov 24, 2025
0 of 12 checks passed
@ASchuberth ASchuberth deleted the exp branch November 24, 2025 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants