make shure that all changes were reflected in the .md file
This commit is contained in:
@@ -33,3 +33,65 @@ The following is suggested.
|
||||
5. Run in a loop where every 30th of a second, update the selected radar.
|
||||
|
||||
======================================================================
|
||||
|
||||
CURRENT IMPLEMENTATION STATUS
|
||||
|
||||
File: src/main.cpp
|
||||
Status: COMPLETE (stub phase)
|
||||
|
||||
The five-step flow described above is fully implemented in main():
|
||||
|
||||
Step 1 — parse_args()
|
||||
Parses argv[] for radar names (chain_home, marine_ascope, marine_traffic,
|
||||
police_boat). Sets radar_management[].available for each named radar.
|
||||
With no arguments, all radars are made available.
|
||||
|
||||
STUB NOTE: The current build unconditionally sets operatable=1 for all four
|
||||
radars before checking availability. When real radar components are built,
|
||||
only the ones that are fully implemented should have operatable set to 1.
|
||||
The check "available only if operatable" already works correctly in the code;
|
||||
only the stub's operatable override needs to be updated.
|
||||
|
||||
Step 2 — GLFW / GLAD / OpenGL initialization
|
||||
Creates a 1920x1080 window (WINDOW_WIDTH x WINDOW_HEIGHT from settings.h),
|
||||
initialises GLAD, enables GL_DEBUG_OUTPUT (controlled by ENABLE_GL_DEBUG_OUTPUT
|
||||
in settings.h), and sets global GL state (blending, no depth test).
|
||||
|
||||
Step 3 — Intro / selection screen
|
||||
Renders the welcome text on the left panel (render_intro_left_panel()) and
|
||||
the radar selection list centred in the scope viewport (render_radar_list()).
|
||||
The status bar shows keyboard instructions (render_selection_status_bar()).
|
||||
|
||||
Step 4 — Selection loop
|
||||
The GLFW key callback (key_callback) handles:
|
||||
- Key 1: step selection forward
|
||||
- Key 2: step selection backward
|
||||
- ENTER: activate the highlighted radar; call reset_radar_controls()
|
||||
- ESC: close the window
|
||||
If exactly one radar is available, the application auto-activates it after
|
||||
5 seconds (shows the selection screen during the countdown; breaks early
|
||||
if ENTER is pressed).
|
||||
|
||||
Step 5 — Main render loop (~30 Hz)
|
||||
Uses std::chrono::steady_clock to target a 1/30 s frame period.
|
||||
Each frame:
|
||||
- Polls GLFW events
|
||||
- If SELECTION state: calls render_selection_screen()
|
||||
- If OPERATING state: calls render_operating_screen(), which delegates
|
||||
to g_active_radar->render_left_panel(), render_status_bar(),
|
||||
render_scope() through the RadarBase virtual interface.
|
||||
|
||||
Additional features implemented:
|
||||
- GL debug callback (gl_debug_callback) enabled via ENABLE_GL_DEBUG_OUTPUT
|
||||
- Debug border-box renderer (draw_border_box) enabled via DEBUG_DRAW_WINDOW_BORDERS
|
||||
in settings.h — draws white outlines around each panel for layout verification
|
||||
- reset_radar_controls(): resets uniform_max_range, uniform_range_cursor,
|
||||
uniform_bearing_cursor to defaults for the selected radar when it is activated
|
||||
- Keyboard controls for all scope uniforms (intensity, sensitivity, STC, noise
|
||||
filter, radiogoniometer, max range, range cursor, bearing cursor, antenna
|
||||
rotation) are implemented in key_callback(); the controls are appropriately
|
||||
restricted by radar type (e.g. noise filter only for PPI scopes)
|
||||
|
||||
Application state is tracked by AppState enum (SELECTION, OPERATING) in main.cpp.
|
||||
The active radar object is pointed to by g_active_radar (a RadarBase*).
|
||||
current_radar (global in global_data.cpp) holds the RADAR_* index of the active radar.
|
||||
|
||||
Reference in New Issue
Block a user