1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-26 19:17:52 +00:00

Begins attempts to keep track of display metrics.

i.e. a system that can both make smart decisions about when to use a lower resolution, and hopefully allow some sort of flywheel-esque horizontal retrace synchronisation. And possibly some raster beam chasing?
This commit is contained in:
Thomas Harte
2019-03-04 21:54:50 -05:00
parent 8915950c7d
commit 86a6b04d4a
5 changed files with 94 additions and 2 deletions
+11 -1
View File
@@ -9,8 +9,9 @@
#ifndef ScanTarget_hpp
#define ScanTarget_hpp
#include "../ScanTarget.hpp"
#include "../Log.hpp"
#include "../DisplayMetrics.hpp"
#include "../ScanTarget.hpp"
#include "OpenGL.hpp"
#include "Primitives/TextureTarget.hpp"
@@ -21,6 +22,7 @@
#include <array>
#include <atomic>
#include <cstdint>
#include <chrono>
#include <list>
#include <memory>
#include <string>
@@ -47,6 +49,9 @@ class ScanTarget: public Outputs::Display::ScanTarget {
/*! Processes all the latest input, at a resolution suitable for later output to a framebuffer of the specified size. */
void update(int output_width, int output_height);
/*! @returns The DisplayMetrics object that this ScanTarget has been providing with announcements and draw overages. */
Metrics &display_metrics();
private:
#ifndef NDEBUG
struct OpenGLVersionDumper {
@@ -78,6 +83,11 @@ class ScanTarget: public Outputs::Display::ScanTarget {
bool output_is_visible_ = false;
Metrics display_metrics_;
size_t lines_submitted_ = 0;
std::chrono::high_resolution_clock::time_point line_submission_begin_time_;
// Extends the definition of a Scan to include two extra fields,
// relevant to the way that this scan target processes video.
struct Scan {