1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-20 10:17:05 +00:00

Corrects vertical event announcement, and adjusts namespaces for OpenGL primitives.

This commit is contained in:
Thomas Harte
2018-11-11 15:11:32 -05:00
parent b70227ac1b
commit be12d78c83
9 changed files with 44 additions and 11 deletions
+12 -4
View File
@@ -16,6 +16,10 @@ namespace {
constexpr int WriteAreaWidth = 2048;
constexpr int WriteAreaHeight = 2048;
constexpr int CompositeLineBufferWidth = 2048;
constexpr int CompositeLineBufferHeight = 2048;
constexpr int CompositeLineBufferTextureUnit = 0;
#define TextureAddress(x, y) (((y) << 11) | (x))
#define TextureAddressGetY(v) uint16_t((v) >> 11)
#define TextureAddressGetX(v) uint16_t((v) & 0x7ff)
@@ -43,7 +47,9 @@ const GLenum formatForDepth(std::size_t depth) {
}
ScanTarget::ScanTarget() {
ScanTarget::ScanTarget() :
composite_line_texture_(CompositeLineBufferWidth, CompositeLineBufferHeight, CompositeLineBufferTextureUnit, GL_LINEAR) {
// Allocate space for the scans.
glGenBuffers(1, &scan_buffer_name_);
glBindBuffer(GL_ARRAY_BUFFER, scan_buffer_name_);
@@ -56,14 +62,13 @@ ScanTarget::ScanTarget() {
// write straight into it.
glGenTextures(1, &write_area_texture_name_);
glGenVertexArrays(1, &vertex_array_);
glGenVertexArrays(1, &scan_vertex_array_);
}
ScanTarget::~ScanTarget() {
// Release scan space.
glDeleteBuffers(1, &scan_buffer_name_);
glDeleteTextures(1, &write_area_texture_name_);
glDeleteVertexArrays(1, &vertex_array_);
glDeleteVertexArrays(1, &scan_vertex_array_);
}
void ScanTarget::set_modals(Modals modals) {
@@ -174,6 +179,9 @@ void ScanTarget::submit() {
allocation_has_failed_ = false;
}
void ScanTarget::announce(Event event, uint16_t x, uint16_t y) {
}
void ScanTarget::draw() {
// Grab the current read and submit pointers.
const auto submit_pointers = submit_pointers_.load();